();
- list.add(DataStore.canolis);
- list.add(DataStore.chris);
-
- baseListModel = new BaseListModel(list.iterator());
- listSearcher = new ListSearcher(baseListModel);
- }
-
- public void testRows(){
- assertEquals(list.size(), listSearcher.getSize());
- }
-
- public void testValueAt(){
- assertEquals(baseListModel.getElementAt(0), listSearcher.getElementAt(0));
- assertNotSame(baseListModel.getElementAt(1), listSearcher.getElementAt(0));
- }
-
-}
Index: lucene/contrib/swing/src/java/org/apache/lucene/swing/models/TableSearcher.java
===================================================================
--- lucene/contrib/swing/src/java/org/apache/lucene/swing/models/TableSearcher.java (revision 1087102)
+++ lucene/contrib/swing/src/java/org/apache/lucene/swing/models/TableSearcher.java (working copy)
@@ -1,362 +0,0 @@
-package org.apache.lucene.swing.models;
-
-/**
- * Copyright 2005 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.util.ArrayList;
-
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-import javax.swing.table.AbstractTableModel;
-import javax.swing.table.TableModel;
-
-import org.apache.lucene.analysis.Analyzer;
-import org.apache.lucene.analysis.core.WhitespaceAnalyzer;
-import org.apache.lucene.document.Document;
-import org.apache.lucene.document.Field;
-import org.apache.lucene.document.Fieldable;
-import org.apache.lucene.index.IndexWriter;
-import org.apache.lucene.index.IndexWriterConfig;
-import org.apache.lucene.queryParser.MultiFieldQueryParser;
-import org.apache.lucene.search.IndexSearcher;
-import org.apache.lucene.search.Query;
-import org.apache.lucene.search.ScoreDoc;
-import org.apache.lucene.store.RAMDirectory;
-import org.apache.lucene.swing.models.ListSearcher.CountingCollector;
-import org.apache.lucene.util.Version;
-
-/**
- * This is a TableModel that encapsulates Lucene
- * search logic within a TableModel implementation.
- * It is implemented as a TableModel decorator,
- * similar to the TableSorter demo from Sun that decorates
- * a TableModel and provides sorting functionality. The benefit
- * of this architecture is that you can decorate any TableModel
- * implementation with this searching table model -- making it
- * easy to add searching functionality to existing JTables -- or
- * making new search capable table lucene.
- *
- * This decorator works by holding a reference to a decorated ot inner
- * TableModel. All data is stored within that table model, not this
- * table model. Rather, this table model simply manages links to
- * data in the inner table model according to the search. All methods on
- * TableSearcher forward to the inner table model with subtle filtering
- * or alteration according to the search criteria.
- *
- *
Using the table model:
- *
- * Pass the TableModel you want to decorate in at the constructor. When
- * the TableModel initializes, it displays all search results. Call
- * the search method with any valid Lucene search String and the data
- * will be filtered by the search string. Users can always clear the search
- * at any time by searching with an empty string. Additionally, you can
- * add a button calling the clearSearch() method.
- *
- */
-public class TableSearcher extends AbstractTableModel {
-
- /**
- * The inner table model we are decorating
- */
- protected TableModel tableModel;
-
- /**
- * This listener is used to register this class as a listener to
- * the decorated table model for update events
- */
- private TableModelListener tableModelListener;
-
- /**
- * these keeps reference to the decorated table model for data
- * only rows that match the search criteria are linked
- */
- private ArrayList rowToModelIndex = new ArrayList();
-
-
- //Lucene stuff.
-
- /**
- * In memory lucene index
- */
- private RAMDirectory directory;
-
- /**
- * Cached lucene analyzer
- */
- private Analyzer analyzer;
-
- /**
- * Links between this table model and the decorated table model
- * are maintained through links based on row number. This is a
- * key constant to denote "row number" for indexing
- */
- private static final String ROW_NUMBER = "ROW_NUMBER";
-
- /**
- * Cache the current search String. Also used internally to
- * key whether there is an active search running or not. i.e. if
- * searchString is null, there is no active search.
- */
- private String searchString = null;
-
- /**
- * @param tableModel The table model to decorate
- */
- public TableSearcher(TableModel tableModel) {
- analyzer = new WhitespaceAnalyzer(Version.LUCENE_CURRENT);
- tableModelListener = new TableModelHandler();
- setTableModel(tableModel);
- tableModel.addTableModelListener(tableModelListener);
- clearSearchingState();
- }
-
- /**
- *
- * @return The inner table model this table model is decorating
- */
- public TableModel getTableModel() {
- return tableModel;
- }
-
- /**
- * Set the table model used by this table model
- * @param tableModel The new table model to decorate
- */
- public void setTableModel(TableModel tableModel) {
-
- //remove listeners if there...
- if (this.tableModel != null) {
- this.tableModel.removeTableModelListener(tableModelListener);
- }
-
- this.tableModel = tableModel;
- if (this.tableModel != null) {
- this.tableModel.addTableModelListener(tableModelListener);
- }
-
- //recalculate the links between this table model and
- //the inner table model since the decorated model just changed
- reindex();
-
- // let all listeners know the table has changed
- fireTableStructureChanged();
- }
-
-
- /**
- * Reset the search results and links to the decorated (inner) table
- * model from this table model.
- */
- private void reindex() {
- try {
- // recreate the RAMDirectory
- directory = new RAMDirectory();
- IndexWriter writer = new IndexWriter(directory, new IndexWriterConfig(
- Version.LUCENE_CURRENT, analyzer));
-
- // iterate through all rows
- for (int row=0; row < tableModel.getRowCount(); row++){
-
- //for each row make a new document
- Document document = new Document();
- //add the row number of this row in the decorated table model
- //this will allow us to retrieve the results later
- //and map this table model's row to a row in the decorated
- //table model
- document.add(new Field(ROW_NUMBER, "" + row, Field.Store.YES, Field.Index.ANALYZED));
- //iterate through all columns
- //index the value keyed by the column name
- //NOTE: there could be a problem with using column names with spaces
- for (int column=0; column < tableModel.getColumnCount(); column++){
- String columnName = tableModel.getColumnName(column);
- String columnValue = String.valueOf(tableModel.getValueAt(row, column)).toLowerCase();
- document.add(new Field(columnName, columnValue, Field.Store.YES, Field.Index.ANALYZED));
- }
- writer.addDocument(document);
- }
- writer.optimize();
- writer.close();
- } catch (Exception e){
- e.printStackTrace();
- }
- }
-
- /**
- * @return The current lucene analyzer
- */
- public Analyzer getAnalyzer() {
- return analyzer;
- }
-
- /**
- * @param analyzer The new analyzer to use
- */
- public void setAnalyzer(Analyzer analyzer) {
- this.analyzer = analyzer;
- //reindex from the model with the new analyzer
- reindex();
-
- //rerun the search if there is an active search
- if (isSearching()){
- search(searchString);
- }
- }
-
- /**
- * Run a new search.
- *
- * @param searchString Any valid lucene search string
- */
- public void search(String searchString){
-
- //if search string is null or empty, clear the search == search all
- if (searchString == null || searchString.equals("")){
- clearSearchingState();
- fireTableDataChanged();
- return;
- }
-
-
- try {
- //cache search String
- this.searchString = searchString;
-
- //make a new index searcher with the in memory (RAM) index.
- IndexSearcher is = new IndexSearcher(directory, true);
-
- //make an array of fields - one for each column
- String[] fields = new String[tableModel.getColumnCount()];
- for (int t=0; t getColumnClass(int column) {
- return tableModel.getColumnClass(column);
- }
-
- @Override
- public boolean isCellEditable(int row, int column) {
- return tableModel.isCellEditable(getModelRow(row), column);
- }
-
- public Object getValueAt(int row, int column) {
- return tableModel.getValueAt(getModelRow(row), column);
- }
-
- @Override
- public void setValueAt(Object aValue, int row, int column) {
- tableModel.setValueAt(aValue, getModelRow(row), column);
- }
-
- private boolean isSearching() {
- return searchString != null;
- }
-
- private class TableModelHandler implements TableModelListener {
- public void tableChanged(TableModelEvent e) {
- // If we're not searching, just pass the event along.
- if (!isSearching()) {
- clearSearchingState();
- reindex();
- fireTableChanged(e);
- return;
- }
-
- // Something has happened to the data that may have invalidated the search.
- reindex();
- search(searchString);
- fireTableDataChanged();
- return;
- }
-
- }
-
-}
Index: lucene/contrib/swing/src/java/org/apache/lucene/swing/models/ListSearcher.java
===================================================================
--- lucene/contrib/swing/src/java/org/apache/lucene/swing/models/ListSearcher.java (revision 1087102)
+++ lucene/contrib/swing/src/java/org/apache/lucene/swing/models/ListSearcher.java (working copy)
@@ -1,311 +0,0 @@
-package org.apache.lucene.swing.models;
-
-/**
- * Copyright 2005 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.io.IOException;
-import java.util.ArrayList;
-
-import javax.swing.AbstractListModel;
-import javax.swing.ListModel;
-import javax.swing.event.ListDataEvent;
-import javax.swing.event.ListDataListener;
-
-import org.apache.lucene.analysis.Analyzer;
-import org.apache.lucene.analysis.core.WhitespaceAnalyzer;
-import org.apache.lucene.document.Document;
-import org.apache.lucene.document.Field;
-import org.apache.lucene.document.Fieldable;
-import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.IndexWriter;
-import org.apache.lucene.index.IndexWriterConfig;
-import org.apache.lucene.index.IndexReader.AtomicReaderContext;
-import org.apache.lucene.queryParser.MultiFieldQueryParser;
-import org.apache.lucene.search.Collector;
-import org.apache.lucene.search.IndexSearcher;
-import org.apache.lucene.search.Query;
-import org.apache.lucene.search.ScoreDoc;
-import org.apache.lucene.search.Scorer;
-import org.apache.lucene.store.RAMDirectory;
-import org.apache.lucene.util.Version;
-
-/**
- * See table searcher explanation.
- *
- */
-public class ListSearcher extends AbstractListModel {
- private ListModel listModel;
-
- /**
- * The reference links between the decorated ListModel
- * and this list model based on search criteria
- */
- private ArrayList rowToModelIndex = new ArrayList();
-
- /**
- * In memory lucene index
- */
- private RAMDirectory directory;
-
- /**
- * Cached lucene analyzer
- */
- private Analyzer analyzer;
-
- /**
- * Links between this list model and the decorated list model
- * are maintained through links based on row number. This is a
- * key constant to denote "row number" for indexing
- */
- private static final String ROW_NUMBER = "ROW_NUMBER";
-
- /**
- * Since we only have one field, unlike lists with multiple
- * fields -- we are just using a constant to denote field name.
- * This is most likely unnecessary and should be removed at
- * a later date
- */
- private static final String FIELD_NAME = "FIELD_NAME";
-
- /**
- * Cache the current search String. Also used internally to
- * key whether there is an active search running or not. i.e. if
- * searchString is null, there is no active search.
- */
- private String searchString = null;
- private ListDataListener listModelListener;
-
- public ListSearcher(ListModel newModel) {
- analyzer = new WhitespaceAnalyzer(Version.LUCENE_CURRENT);
- setListModel(newModel);
- listModelListener = new ListModelHandler();
- newModel.addListDataListener(listModelListener);
- clearSearchingState();
- }
-
- private void setListModel(ListModel newModel) {
- //remove listeners if there...
- if (newModel != null) {
- newModel.removeListDataListener(listModelListener);
- }
-
- listModel = newModel;
- if (listModel != null) {
- listModel.addListDataListener(listModelListener);
- }
-
- //recalculate the links between this list model and
- //the inner list model since the decorated model just changed
- reindex();
-
- // let all listeners know the list has changed
- fireContentsChanged(this, 0, getSize());
- }
-
- private void reindex() {
- try {
- // recreate the RAMDirectory
- directory = new RAMDirectory();
- IndexWriter writer = new IndexWriter(directory, new IndexWriterConfig(Version.LUCENE_CURRENT, analyzer));
-
- // iterate through all rows
- for (int row=0; row < listModel.getSize(); row++){
-
- //for each row make a new document
- Document document = new Document();
- //add the row number of this row in the decorated list model
- //this will allow us to retrieve the results later
- //and map this list model's row to a row in the decorated
- //list model
- document.add(new Field(ROW_NUMBER, "" + row, Field.Store.YES, Field.Index.ANALYZED));
- //add the string representation of the row to the index
- document.add(new Field(FIELD_NAME, String.valueOf(listModel.getElementAt(row)).toLowerCase(), Field.Store.YES, Field.Index.ANALYZED));
- writer.addDocument(document);
- }
- writer.optimize();
- writer.close();
- } catch (Exception e){
- e.printStackTrace();
- }
- }
-
- /**
- * Run a new search.
- *
- * @param searchString Any valid lucene search string
- */
- public void search(String searchString){
-
- //if search string is null or empty, clear the search == search all
- if (searchString == null || searchString.equals("")){
- clearSearchingState();
- fireContentsChanged(this, 0, getSize());
- return;
- }
-
-
- try {
- //cache search String
- this.searchString = searchString;
-
- //make a new index searcher with the in memory (RAM) index.
- IndexSearcher is = new IndexSearcher(directory, true);
-
- //make an array of fields - one for each column
- String[] fields = {FIELD_NAME};
-
- //build a query based on the fields, searchString and cached analyzer
- //NOTE: This is an area for improvement since the MultiFieldQueryParser
- // has some weirdness.
- MultiFieldQueryParser parser = new MultiFieldQueryParser(Version.LUCENE_CURRENT, fields, analyzer);
- Query query =parser.parse(searchString);
- //reset this list model with the new results
- resetSearchResults(is, query);
- } catch (Exception e){
- e.printStackTrace();
- }
-
- //notify all listeners that the list has been changed
- fireContentsChanged(this, 0, getSize());
- }
-
- final static class CountingCollector extends Collector {
- public int numHits = 0;
-
- @Override
- public void setScorer(Scorer scorer) throws IOException {}
- @Override
- public void collect(int doc) throws IOException {
- numHits++;
- }
-
- @Override
- public void setNextReader(AtomicReaderContext context) {}
- @Override
- public boolean acceptsDocsOutOfOrder() {
- return true;
- }
- }
-
-
- /**
- *
- * @param hits The new result set to set this list to.
- */
- private void resetSearchResults(IndexSearcher searcher, Query query) {
- try {
- //clear our index mapping this list model rows to
- //the decorated inner list model
- rowToModelIndex.clear();
-
- CountingCollector countingCollector = new CountingCollector();
- searcher.search(query, countingCollector);
- ScoreDoc[] hits = searcher.search(query, countingCollector.numHits).scoreDocs;
-
- //iterate through the hits
- //get the row number stored at the index
- //that number is the row number of the decorated
- //table model row that we are mapping to
- for (int t=0; t
-
-
-
-Decorators for JTable TableModel and JList ListModel encapsulating Lucene indexing and searching functionality.
-
-
Index: lucene/contrib/swing/src/java/overview.html
===================================================================
--- lucene/contrib/swing/src/java/overview.html (revision 1087102)
+++ lucene/contrib/swing/src/java/overview.html (working copy)
@@ -1,23 +0,0 @@
-
-
-
- Apache Lucene Swing Component Models
-
-
-
-
\ No newline at end of file
Index: lucene/contrib/swing/docs/index.html
===================================================================
--- lucene/contrib/swing/docs/index.html (revision 1087102)
+++ lucene/contrib/swing/docs/index.html (working copy)
@@ -1,97 +0,0 @@
-
-
-
-Lucene Powered Swing Data Models
-
-
-
- Lucene Powered Swing Data Models
-by Jonathan Simon
-
-What it is.
-This package contains classes that help you easily integrate Lucene based searching
- into your Swing components. Currently there are classes to index and search
- JTables and JLists. This is done using model decorators rather than custom models
- to make it easier to search current models as well as new ones.
-These models do not actually contain any data. Rather, the ListModel
- decorator (ListSearcher) and the TableModel decorator (TableSearcher) take a
- model in the constructor and delegate all calls to it (after a little alteration,
- but we'll get to that). That said, these are not full fledged models themselves.
- You still have to have another model to decorate with the searching models.
- If you are adding searching to a pre-existing model, you can use your pre-existing
- model directly. Otherwise, you can implement a model from scratch or use a pre-existing
- one to get started.
-What it isn't.
-A complete component: These are just models. They are not complete components
- with search fields and buttons laid out like a searchable interface. You still
- have to build that since the UI changes drastically between applciations.
-A complete model: There are just model decorators. You can't just set the model
- of a JList or JTable to one of these models, and you can't add data directly
- to these models.
-A front end for a lucene index: In other words, you can't use these classes
- to point a JTable directly to a Lucene index. Although that's interesting in
- its own right, this is not that.
-Usage:
-Coding to both models nearly identical. They both take the model to decorate
- at construction time. Here is the code from the demo to decorate a JTable model
- with the TableSearcher and set it as the table model.
-//make a new JTable
-JTable table = new JTable();
-//make my base model, the model with the data
-BaseTableModel tableModel = new BaseTableModel(DataStore.getRestaurants());
-//decorate the tableModel with the TableSearcher
-TableSearcher searchTableModel = new TableSearcher(tableModel);
-//set the TableModel in the table to the TableSearcher
-table.setModel(searchTableModel);
-
-Initially, you won't notice a difference. This is because there is no active
- search which displays all data from the underlying model. You search by calling
- the search() method passing a search string. This filters the data
- set down without changing the underlying data model -- one of the main reasons
- for decorating in the first place. Any valid Lucene search string should work
- (see notes for more info on this). You'll probaby have some code somewhere like
- this in your app to connect a text field and search button to the model.
-//create components
-final JTextField searchField = new JTextField();
-JButton searchButton = new JButton("Go");
-
-//make an action listener
-ActionListener searchListener = new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- searchTableModel.search(searchField.getText().trim().toLowerCase());
- }
-};
-
-//register listeners
-searchButton.addActionListener(searchListener);
-searchField.addActionListener(searchListener);
-You also might want to have a clear search button, working the same way. But
- to keep things simple, if you search will a null String or an empty
- String, the search clears and you will once again see all of your data.
-Demo notes:
-The list demo does real time searching. In other words, as you type, searches
- run and the result set updates. The table demo has a search button, and only
- searches when the button is clicked. They both work, I just implemented them
- this way to show the different UI metaphors and that they both work.
-Implementation notes:
-This code started as a proof of concept so it's not a fully featured
- model. Don't get me wrong, it fully works, but it could use some improvement
- that it will hopefully get over time. I just wanted to get it out there and
- get people using it. I'm also trying to keep everything as simple as possible.
- Here are some of the issues.
-
- - You can't change the model after the Searcher is constructed.
- - The search model decorators do update when the decorated model
- is updated, but not in a very efficient way. The whole search model is reindexed
- when anything changes. This is a definite scaling issue.
- - The indexing and searching logic needs to be generally more configurable
- to allow custom tailoring of searched and indexing.
- - The TableSearcher uses column names to index column values. This could be
- an issue with multiple word column names.
- - The ListSearcher uses MultiFieldQueryParser even though its not really indexing
- multiple fields.
-
-
-
-
-
Index: lucene/contrib/swing/build.xml
===================================================================
--- lucene/contrib/swing/build.xml (revision 1087102)
+++ lucene/contrib/swing/build.xml (working copy)
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
- Swing Models
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Index: lucene/contrib/lucli/lib/jline-LICENSE-BSD_LIKE.txt
===================================================================
--- lucene/contrib/lucli/lib/jline-LICENSE-BSD_LIKE.txt (revision 1087102)
+++ lucene/contrib/lucli/lib/jline-LICENSE-BSD_LIKE.txt (working copy)
@@ -1,33 +0,0 @@
-Copyright (c) 2002, 2003, 2004, 2005, Marc Prud'hommeaux
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or
-without modification, are permitted provided that the following
-conditions are met:
-
-Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-
-Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer
-in the documentation and/or other materials provided with
-the distribution.
-
-Neither the name of JLine nor the names of its contributors
-may be used to endorse or promote products derived from this
-software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
-OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
-AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-OF THE POSSIBILITY OF SUCH DAMAGE.
-
Index: lucene/contrib/lucli/lib/jline.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: lucene/contrib/lucli/lib/jline-NOTICE.txt
===================================================================
--- lucene/contrib/lucli/lib/jline-NOTICE.txt (revision 1087102)
+++ lucene/contrib/lucli/lib/jline-NOTICE.txt (working copy)
@@ -1,2 +0,0 @@
-JLine (under contrib/lucli/lib/jline.jar) is licensed under the BSD License.
-See http://jline.sourceforge.net/
\ No newline at end of file
Index: lucene/contrib/lucli/src/java/lucli/LuceneMethods.java
===================================================================
--- lucene/contrib/lucli/src/java/lucli/LuceneMethods.java (revision 1087102)
+++ lucene/contrib/lucli/src/java/lucli/LuceneMethods.java (working copy)
@@ -1,404 +0,0 @@
-package lucli;
-
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.io.File;
-import java.io.IOException;
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-
-import jline.ConsoleReader;
-
-import org.apache.lucene.analysis.Analyzer;
-import org.apache.lucene.analysis.TokenStream;
-import org.apache.lucene.analysis.standard.StandardAnalyzer;
-import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
-import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
-import org.apache.lucene.document.Document;
-import org.apache.lucene.document.Fieldable;
-import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.IndexReader.AtomicReaderContext;
-import org.apache.lucene.index.IndexWriter;
-import org.apache.lucene.index.IndexWriterConfig;
-import org.apache.lucene.index.Fields;
-import org.apache.lucene.index.FieldsEnum;
-import org.apache.lucene.index.TermsEnum;
-import org.apache.lucene.index.MultiFields;
-import org.apache.lucene.index.IndexReader.FieldOption;
-import org.apache.lucene.index.IndexWriterConfig.OpenMode;
-import org.apache.lucene.queryParser.MultiFieldQueryParser;
-import org.apache.lucene.queryParser.ParseException;
-import org.apache.lucene.search.Collector;
-import org.apache.lucene.search.Explanation;
-import org.apache.lucene.search.Query;
-import org.apache.lucene.search.ScoreDoc;
-import org.apache.lucene.search.Scorer;
-import org.apache.lucene.search.IndexSearcher;
-import org.apache.lucene.store.FSDirectory;
-import org.apache.lucene.util.Version;
-import org.apache.lucene.util.BytesRef;
-
-/**
- * Various methods that interact with Lucene and provide info about the
- * index, search, etc. Parts adapted from Lucene demo.
- */
-class LuceneMethods {
-
- private int numDocs;
- private final FSDirectory indexName; //directory of this index
- private List fields; //Fields as a vector
- private List indexedFields; //Fields as a vector
- private String fieldsArray[]; //Fields as an array
- private IndexSearcher searcher;
- private Query query; //current query string
- private String analyzerClassFQN = null; // Analyzer class, if NULL, use default Analyzer
-
- public LuceneMethods(String index) throws IOException {
- indexName = FSDirectory.open(new File(index));
- message("Lucene CLI. Using directory '" + indexName + "'. Type 'help' for instructions.");
- }
-
- private Analyzer createAnalyzer() {
- if (analyzerClassFQN == null) return new StandardAnalyzer(Version.LUCENE_CURRENT);
- try {
- return Class.forName(analyzerClassFQN).asSubclass(Analyzer.class).newInstance();
- } catch (ClassCastException cce) {
- message("Given class is not an Analyzer: " + analyzerClassFQN);
- return new StandardAnalyzer(Version.LUCENE_CURRENT);
- } catch (Exception e) {
- message("Unable to use Analyzer " + analyzerClassFQN);
- return new StandardAnalyzer(Version.LUCENE_CURRENT);
- }
- }
-
-
- public void info() throws java.io.IOException {
- IndexReader indexReader = IndexReader.open(indexName, true);
-
-
- getFieldInfo();
- numDocs = indexReader.numDocs();
- message("Index has " + numDocs + " documents ");
- message("All Fields:" + fields.toString());
- message("Indexed Fields:" + indexedFields.toString());
-
- if (IndexWriter.isLocked(indexName)) {
- message("Index is locked");
- }
- //IndexReader.getCurrentVersion(indexName);
- //System.out.println("Version:" + version);
-
- indexReader.close();
- }
-
-
- public void search(String queryString, boolean explain, boolean showTokens, ConsoleReader cr)
- throws java.io.IOException, org.apache.lucene.queryParser.ParseException {
- initSearch(queryString);
- int numHits = computeCount(query);
- message(numHits + " total matching documents");
- if (explain) {
- query = explainQuery(queryString);
- }
-
- final int HITS_PER_PAGE = 10;
- message("--------------------------------------");
- for (int start = 0; start < numHits; start += HITS_PER_PAGE) {
- int end = Math.min(numHits, start + HITS_PER_PAGE);
- ScoreDoc[] hits = search(query, end);
- for (int ii = start; ii < end; ii++) {
- Document doc = searcher.doc(hits[ii].doc);
- message("---------------- " + (ii + 1) + " score:" + hits[ii].score + "---------------------");
- printHit(doc);
- if (showTokens) {
- invertDocument(doc);
- }
- if (explain) {
- Explanation exp = searcher.explain(query, hits[ii].doc);
- message("Explanation:" + exp.toString());
- }
- }
- message("#################################################");
-
- if (numHits > end) {
- // TODO: don't let the input end up in the command line history
- queryString = cr.readLine("more (y/n) ? ");
- if (queryString.length() == 0 || queryString.charAt(0) == 'n')
- break;
- }
- }
- searcher.close();
- }
-
- /**
- * TODO: Allow user to specify what field(s) to display
- */
- private void printHit(Document doc) {
- for (int ii = 0; ii < fieldsArray.length; ii++) {
- String currField = fieldsArray[ii];
- String[] result = doc.getValues(currField);
- if (result != null) {
- for (int i = 0; i < result.length; i++) {
- message(currField + ":" + result[i]);
- }
- } else {
- message(currField + ": ");
- }
- }
- //another option is to just do message(doc);
- }
-
- public void optimize() throws IOException {
- //open the index writer. False: don't create a new one
- IndexWriter indexWriter = new IndexWriter(indexName, new IndexWriterConfig(
- Version.LUCENE_CURRENT, createAnalyzer()).setOpenMode(
- OpenMode.APPEND));
- message("Starting to optimize index.");
- long start = System.currentTimeMillis();
- indexWriter.optimize();
- message("Done optimizing index. Took " + (System.currentTimeMillis() - start) + " msecs");
- indexWriter.close();
- }
-
-
- private Query explainQuery(String queryString) throws IOException, ParseException {
-
- searcher = new IndexSearcher(indexName, true);
- Analyzer analyzer = createAnalyzer();
- getFieldInfo();
-
- int arraySize = indexedFields.size();
- String indexedArray[] = new String[arraySize];
- for (int ii = 0; ii < arraySize; ii++) {
- indexedArray[ii] = indexedFields.get(ii);
- }
- MultiFieldQueryParser parser = new MultiFieldQueryParser(Version.LUCENE_CURRENT, indexedArray, analyzer);
- query = parser.parse(queryString);
- message("Searching for: " + query.toString());
- return (query);
-
- }
-
- /**
- * TODO: Allow user to specify analyzer
- */
- private void initSearch(String queryString) throws IOException, ParseException {
-
- searcher = new IndexSearcher(indexName, true);
- Analyzer analyzer = createAnalyzer();
- getFieldInfo();
-
- int arraySize = fields.size();
- fieldsArray = new String[arraySize];
- for (int ii = 0; ii < arraySize; ii++) {
- fieldsArray[ii] = fields.get(ii);
- }
- MultiFieldQueryParser parser = new MultiFieldQueryParser(Version.LUCENE_CURRENT, fieldsArray, analyzer);
- query = parser.parse(queryString);
- System.out.println("Searching for: " + query.toString());
- }
-
- final static class CountingCollector extends Collector {
- public int numHits = 0;
-
- @Override
- public void setScorer(Scorer scorer) throws IOException {}
- @Override
- public void collect(int doc) throws IOException {
- numHits++;
- }
-
- @Override
- public void setNextReader(AtomicReaderContext context) {}
- @Override
- public boolean acceptsDocsOutOfOrder() {
- return true;
- }
- }
-
- private int computeCount(Query q) throws IOException {
- CountingCollector countingCollector = new CountingCollector();
-
- searcher.search(q, countingCollector);
- return countingCollector.numHits;
- }
-
- public void count(String queryString) throws java.io.IOException, ParseException {
- initSearch(queryString);
- message(computeCount(query) + " total documents");
- searcher.close();
- }
-
- private ScoreDoc[] search(Query q, int numHits) throws IOException {
- return searcher.search(query, numHits).scoreDocs;
- }
-
- static public void message(String s) {
- System.out.println(s);
- }
-
- private void getFieldInfo() throws IOException {
- IndexReader indexReader = IndexReader.open(indexName, true);
- fields = new ArrayList();
- indexedFields = new ArrayList();
-
- //get the list of all field names
- for(String field : indexReader.getFieldNames(FieldOption.ALL)) {
- if (field != null && !field.equals(""))
- fields.add(field.toString());
- }
- //
- //get the list of indexed field names
- for(String field : indexReader.getFieldNames(FieldOption.INDEXED)) {
- if (field != null && !field.equals(""))
- indexedFields.add(field.toString());
- }
- indexReader.close();
- }
-
-
- // Copied from DocumentWriter
- // Tokenizes the fields of a document into Postings.
- private void invertDocument(Document doc)
- throws IOException {
-
- Map tokenMap = new HashMap();
- final int maxFieldLength = 10000;
-
- Analyzer analyzer = createAnalyzer();
- for (Fieldable field : doc.getFields()) {
- String fieldName = field.name();
- if (field.isIndexed()) {
- if (field.isTokenized()) { // un-tokenized field
- Reader reader; // find or make Reader
- if (field.readerValue() != null)
- reader = field.readerValue();
- else if (field.stringValue() != null)
- reader = new StringReader(field.stringValue());
- else
- throw new IllegalArgumentException
- ("field must have either String or Reader value");
-
- int position = 0;
- // Tokenize field and add to postingTable
- TokenStream stream = analyzer.tokenStream(fieldName, reader);
- CharTermAttribute termAtt = stream.addAttribute(CharTermAttribute.class);
- PositionIncrementAttribute posIncrAtt = stream.addAttribute(PositionIncrementAttribute.class);
-
- try {
- while (stream.incrementToken()) {
- position += (posIncrAtt.getPositionIncrement() - 1);
- position++;
- String name = termAtt.toString();
- Integer Count = tokenMap.get(name);
- if (Count == null) { // not in there yet
- tokenMap.put(name, Integer.valueOf(1)); //first one
- } else {
- int count = Count.intValue();
- tokenMap.put(name, Integer.valueOf(count + 1));
- }
- if (position > maxFieldLength) break;
- }
- } finally {
- stream.close();
- }
- }
-
- }
- }
- Map.Entry[] sortedHash = getSortedMapEntries(tokenMap);
- for (int ii = 0; ii < sortedHash.length && ii < 10; ii++) {
- Map.Entry currentEntry = sortedHash[ii];
- message((ii + 1) + ":" + currentEntry.getKey() + " " + currentEntry.getValue());
- }
- }
-
-
- /** Provides a list of the top terms of the index.
- *
- * @param field - the name of the command or null for all of them.
- */
- public void terms(String field) throws IOException {
- TreeMap termMap = new TreeMap();
- IndexReader indexReader = IndexReader.open(indexName, true);
- Fields fields = MultiFields.getFields(indexReader);
- if (fields != null) {
- FieldsEnum fieldsEnum = fields.iterator();
- String curField;
- while((curField = fieldsEnum.next()) != null) {
- TermsEnum terms = fieldsEnum.terms();
- BytesRef text;
- while ((text = terms.next()) != null) {
- //message(term.field() + ":" + term.text() + " freq:" + terms.docFreq());
- //if we're either not looking by field or we're matching the specific field
- if ((field == null) || field.equals(curField)) {
- termMap.put(curField + ":" + text.utf8ToString(), Integer.valueOf((terms.docFreq())));
- }
- }
- }
- }
-
- Iterator termIterator = termMap.keySet().iterator();
- for (int ii = 0; termIterator.hasNext() && ii < 100; ii++) {
- String termDetails = termIterator.next();
- Integer termFreq = termMap.get(termDetails);
- message(termDetails + ": " + termFreq);
- }
- indexReader.close();
- }
-
- /** Sort Map values
- * @param m the map we're sorting
- * from http://developer.java.sun.com/developer/qow/archive/170/index.jsp
- */
- @SuppressWarnings("unchecked")
- public static > Map.Entry[]
- getSortedMapEntries(Map m) {
- Set> set = m.entrySet();
- Map.Entry[] entries =
- set.toArray(new Map.Entry[set.size()]);
- Arrays.sort(entries, new Comparator>() {
- public int compare(Map.Entry o1, Map.Entry o2) {
- V v1 = o1.getValue();
- V v2 = o2.getValue();
- return v2.compareTo(v1); //descending order
- }
- });
- return entries;
- }
-
- public void analyzer(String word) {
- if ("current".equals(word)) {
- String current = analyzerClassFQN == null ? "StandardAnalyzer" : analyzerClassFQN;
- message("The currently used Analyzer class is: " + current);
- return;
- }
- analyzerClassFQN = word;
- message("Switched to Analyzer class " + analyzerClassFQN);
- }
-}
-
Index: lucene/contrib/lucli/src/java/lucli/Lucli.java
===================================================================
--- lucene/contrib/lucli/src/java/lucli/Lucli.java (revision 1087102)
+++ lucene/contrib/lucli/src/java/lucli/Lucli.java (working copy)
@@ -1,321 +0,0 @@
-package lucli;
-
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.io.File;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.TreeMap;
-
-import jline.ArgumentCompletor;
-import jline.Completor;
-import jline.ConsoleReader;
-import jline.FileNameCompletor;
-import jline.History;
-import jline.SimpleCompletor;
-
-import org.apache.lucene.queryParser.ParseException;
-
-/**
- * Main class for lucli: the Lucene Command Line Interface.
- * This class handles mostly the actual CLI part, command names, help, etc.
- */
-public class Lucli {
-
- final static String DEFAULT_INDEX = "index"; //directory "index" under the current directory
- final static String HISTORYFILE = ".lucli"; //history file in user's home directory
- public final static int MAX_TERMS = 100; //Maximum number of terms we're going to show
-
- // List of commands
- // To add another command, add it in here, in the list of addcomand(), and in the switch statement
- final static int NOCOMMAND = -2;
- final static int UNKOWN = -1;
- final static int INFO = 0;
- final static int SEARCH = 1;
- final static int OPTIMIZE = 2;
- final static int QUIT = 3;
- final static int HELP = 4;
- final static int COUNT = 5;
- final static int TERMS = 6;
- final static int INDEX = 7;
- final static int TOKENS = 8;
- final static int EXPLAIN = 9;
- final static int ANALYZER = 10;
-
- String historyFile;
- TreeMap commandMap = new TreeMap();
- LuceneMethods luceneMethods; //current cli class we're using
- boolean enableReadline; //false: use plain java. True: shared library readline
-
- /**
- Main entry point. The first argument can be a filename with an
- application initialization file.
- */
-
- public Lucli(String[] args) throws IOException {
- String line;
-
- historyFile = System.getProperty("user.home") + File.separator + HISTORYFILE;
-
- /*
- * Initialize the list of commands
- */
- addCommand("info", INFO, "Display info about the current Lucene index. Example: info");
- addCommand("search", SEARCH, "Search the current index. Example: search foo", 1);
- addCommand("count", COUNT, "Return the number of hits for a search. Example: count foo", 1);
- addCommand("optimize", OPTIMIZE, "Optimize the current index");
- addCommand("quit", QUIT, "Quit/exit the program");
- addCommand("help", HELP, "Display help about commands");
- addCommand("terms", TERMS, "Show the first " + MAX_TERMS + " terms in this index. Supply a field name to only show terms in a specific field. Example: terms");
- addCommand("index", INDEX, "Choose a different lucene index. Example index my_index", 1);
- addCommand("tokens", TOKENS, "Does a search and shows the top 10 tokens for each document. Verbose! Example: tokens foo", 1);
- addCommand("explain", EXPLAIN, "Explanation that describes how the document scored against query. Example: explain foo", 1);
- addCommand("analyzer", ANALYZER, "Specifies the Analyzer class to be used. Example: analyzer org.apache.lucene.analysis.SimpleAnalyzer", 1);
-
- //parse command line arguments
- parseArgs(args);
-
- ConsoleReader cr = new ConsoleReader();
- //Readline.readHistoryFile(fullPath);
- cr.setHistory(new History(new File(historyFile)));
-
- // set completer with list of words
- Completor[] comp = new Completor[]{
- new SimpleCompletor(getCommandsAsArray()),
- new FileNameCompletor()
- };
- cr.addCompletor (new ArgumentCompletor(comp));
-
- // main input loop
- luceneMethods = new LuceneMethods(DEFAULT_INDEX);
- while (true) {
- try {
- line = cr.readLine("lucli> ");
- if (line != null) {
- handleCommand(line, cr);
- }
- } catch (java.io.EOFException eof) {
- System.out.println("");//new line
- exit();
- } catch (UnsupportedEncodingException enc) {
- enc.printStackTrace(System.err);
- } catch (ParseException pe) {
- pe.printStackTrace(System.err);
- } catch (IOException ioe) {
- ioe.printStackTrace(System.err);
- }
- }
- }
-
- private String[] getCommandsAsArray() {
- Set commandSet = commandMap.keySet();
- String[] commands = new String[commandMap.size()];
- int i = 0;
- for (Iterator iter = commandSet.iterator(); iter.hasNext();) {
- String cmd = iter.next();
- commands[i++] = cmd;
- }
- return commands;
- }
-
- public static void main(String[] args) throws IOException {
- new Lucli(args);
- }
-
-
- private void handleCommand(String line, ConsoleReader cr) throws IOException, ParseException {
- String [] words = tokenizeCommand(line);
- if (words.length == 0)
- return; //white space
- String query = "";
- if (line.trim().startsWith("#")) // # = comment
- return;
- //Command name and number of arguments
- switch (getCommandId(words[0], words.length - 1)) {
- case INFO:
- luceneMethods.info();
- break;
- case SEARCH:
- for (int ii = 1; ii < words.length; ii++) {
- query += words[ii] + " ";
- }
- luceneMethods.search(query, false, false, cr);
- break;
- case COUNT:
- for (int ii = 1; ii < words.length; ii++) {
- query += words[ii] + " ";
- }
- luceneMethods.count(query);
- break;
- case QUIT:
- exit();
- break;
- case TERMS:
- if(words.length > 1)
- luceneMethods.terms(words[1]);
- else
- luceneMethods.terms(null);
- break;
- case INDEX:
- LuceneMethods newLm = new LuceneMethods(words[1]);
- try {
- newLm.info(); //will fail if can't open the index
- luceneMethods = newLm; //OK, so we'll use the new one
- } catch (IOException ioe) {
- //problem we'll keep using the old one
- error(ioe.toString());
- }
- break;
- case OPTIMIZE:
- luceneMethods.optimize();
- break;
- case TOKENS:
- for (int ii = 1; ii < words.length; ii++) {
- query += words[ii] + " ";
- }
- luceneMethods.search(query, false, true, cr);
- break;
- case EXPLAIN:
- for (int ii = 1; ii < words.length; ii++) {
- query += words[ii] + " ";
- }
- luceneMethods.search(query, true, false, cr);
- break;
- case ANALYZER:
- luceneMethods.analyzer(words[1]);
- break;
- case HELP:
- help();
- break;
- case NOCOMMAND: //do nothing
- break;
- case UNKOWN:
- System.out.println("Unknown command: " + words[0] + ". Type help to get a list of commands.");
- break;
- }
- }
-
- private String [] tokenizeCommand(String line) {
- StringTokenizer tokenizer = new StringTokenizer(line, " \t");
- int size = tokenizer.countTokens();
- String [] tokens = new String[size];
- for (int ii = 0; tokenizer.hasMoreTokens(); ii++) {
- tokens[ii] = tokenizer.nextToken();
- }
- return tokens;
- }
-
- private void exit() {
- System.exit(0);
- }
-
- /**
- * Add a command to the list of commands for the interpreter for a
- * command that doesn't take any parameters.
- * @param name - the name of the command
- * @param id - the unique id of the command
- * @param help - the help message for this command
- */
- private void addCommand(String name, int id, String help) {
- addCommand(name, id, help, 0);
- }
-
- /**
- * Add a command to the list of commands for the interpreter.
- * @param name - the name of the command
- * @param id - the unique id of the command
- * @param help - the help message for this command
- * @param params - the minimum number of required params if any
- */
- private void addCommand(String name, int id, String help, int params) {
- Command command = new Command(name, id, help, params);
- commandMap.put(name, command);
- }
-
- private int getCommandId(String name, int params) {
- name = name.toLowerCase(); //treat uppercase and lower case commands the same
- Command command = commandMap.get(name);
- if (command == null) {
- return(UNKOWN);
- }
- else {
- if(command.params > params) {
- error(command.name + " needs at least " + command.params + " arguments.");
- return (NOCOMMAND);
- }
- return (command.id);
- }
- }
-
- private void help() {
- Iterator commands = commandMap.keySet().iterator();
- while (commands.hasNext()) {
- Command command = commandMap.get(commands.next());
- System.out.println("\t" + command.name + ": " + command.help);
-
- }
- }
-
- private void error(String message) {
- System.err.println("Error:" + message);
- }
-
- private void message(String text) {
- System.out.println(text);
- }
-
- /*
- * Parse command line arguments (currently none)
- */
- private void parseArgs(String[] args) {
- if (args.length > 0) {
- usage();
- System.exit(1);
- }
- }
-
- private void usage() {
- message("Usage: lucli.Lucli");
- message("(currently, no parameters are supported)");
- }
-
- private class Command {
- String name;
- int id;
- String help;
- int params;
-
- Command(String name, int id, String help, int params) {
- this.name = name;
- this.id = id;
- this.help = help;
- this.params = params;
- }
-
- /**
- * Prints out a usage message for this command.
- */
- public String commandUsage() {
- return (name + ":" + help + ". Command takes " + params + " params");
- }
-
- }
-}
Index: lucene/contrib/lucli/src/java/lucli/package.html
===================================================================
--- lucene/contrib/lucli/src/java/lucli/package.html (revision 1087102)
+++ lucene/contrib/lucli/src/java/lucli/package.html (working copy)
@@ -1,22 +0,0 @@
-
-
-
-
-Lucene Command Line Interface
-
-
Index: lucene/contrib/lucli/src/java/overview.html
===================================================================
--- lucene/contrib/lucli/src/java/overview.html (revision 1087102)
+++ lucene/contrib/lucli/src/java/overview.html (working copy)
@@ -1,26 +0,0 @@
-
-
-
-
- lucli
-
-
-
- lucli
-
-
\ No newline at end of file
Index: lucene/contrib/lucli/README
===================================================================
--- lucene/contrib/lucli/README (revision 1087102)
+++ lucene/contrib/lucli/README (working copy)
@@ -1,24 +0,0 @@
-lucli (pronounced Luckily) is the Lucene Command Line Interface.
-
-INSTALLATION
-
-Call "ant", then call the run.sh shell script. If it doesn't work right away:
- Edit JAVA_HOME to point to your java directory.
- Edit LUCLI to point to where you installed lucli.
- Edit LUCLI_MEMORY and set it to the maximum amount of memory you want to allocate to lucli
- You can also replace the Lucene jar file that came with lucli with your own.
-
-
-ENABLING READLINE
-
-Readline support should automatically work thanks to JLine, see http://jline.sourceforge.net/
-
-
-Documentation
-
-There is none :-). Type help at the command line or read the code.
-
-Enjoy
-
-Dror Matalon
-dror@zapatec.com.
Index: lucene/contrib/lucli/run.sh
===================================================================
--- lucene/contrib/lucli/run.sh (revision 1087102)
+++ lucene/contrib/lucli/run.sh (working copy)
@@ -1,22 +0,0 @@
-
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LUCLI=.
-LUCLI_MEMORY=128M
-#JAVA_HOME=/home/dror/j2sdk1.4.1_03/
-CLASSPATH=${CLASSPATH}:$LUCLI/lib/jline.jar:$LUCLI/lib/lucene.jar:$LUCLI/dist/lucli-dev.jar
-export CLASSPATH
-$JAVA_HOME/bin/java -Xmx${LUCLI_MEMORY} lucli.Lucli
Index: lucene/contrib/lucli/build.xml
===================================================================
--- lucene/contrib/lucli/build.xml (revision 1087102)
+++ lucene/contrib/lucli/build.xml (working copy)
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
- Lucene Command Line Interface
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-