I've the following problem:
I've a big number of documents indexed.
Suppose that the search query contains 20 terms. It is necessary to find
all documents which contains at least 5 terms from search query.
Is it possible to implement? If yes, what problems may arise during the
solving of thi
Is it possible to add records into lucene index using following
algorithm:
1) create Document object
2) add 5 fields into Document (id, name, field1, field2, field3). All
fields are stored, indexed and tokenized
3) check if the document with current id and name was added before
4) if yes
Ir is IndexReader.
termIdent is Term
int freq = ir.docFreq(termIdent);
if (freq > 1) {
TermDocs termDocs = ir.termDocs(termIdent);
int[] docsArr = new int[freq];
int[] freqArr = new int[freq];
int number = termDocs.read(docsArr,freqArr);
System.out.println(number)
I have a problem.
There is an index, which contains about 6,000,000 records (15,000,000
will be soon) the size is 4GB. Index is optimized and consists of only
one segment. This index stores the products. Each product has brand,
price and about 10 more additional fields. I want to not just find
so
Is it possible to make search among results of previous search?
For example: I made search:
Searcher searcher =...
Query query = ...
Hits hits =
hits = Searcher.search(query);
After it I want to not make a new search, I want to make search among found
results
Now I create new search for get number of results. For example:
IndexSearcher is = ...
Query q = ...
numberOfResults = Is.search(q).length();
Can I accelerate this example ? And how ?
What faster RangeQuery or RangeFilter ?
I try 2 way for get count results:
1)
Query q =
IndexSearcher is =
int count = Is.search(q).length();
2)
Query q =
IndexSearcher is =
CountCollector collector = new CountCollector();
Is.search(q, collector);
Int count = collector.getCount();
First way return results for 1.644