Index doubling in size when adding extra terms

2009-07-15 Thread Gregory Tarr
I have added a new field to each document in my index containing substrings of another field to speed up initial-wildcard searches. Each document has a field "text" which might contain "the quick brown fox jumped over the lazy dogs" The new field - "text_substrings" would then contain "the quick u

Unsupported operation in DocIdSetIterator using lucene 2.9

2010-05-12 Thread Gregory Tarr
I am using lucene 2.9 and I can't understand why a succession of un-deprecated methods calls a deprecated method in this class. The series of calls is as follows: Searcher.search(Query, Collector) IndexSearcher.search(Weight, Filter, Collector) Scorer.score(Collector) DocIdSetIterator.nextDoc() Do

How to influence the score in lucene 2.9

2010-05-12 Thread Gregory Tarr
How easy is it to influence the score of search results in lucene 2.9? The situation is that we have a large number of dated documents that match the term "john" but we want to return the latest documents when "john" is the search term. My solution to this would be to override the score such that

Closing and reopening readers

2010-07-30 Thread Gregory Tarr
I'm having trouble with the IndexReader class as per below: (using lucene 2.9.1) RAMDirectory dir = new RAMDirectory(); createIndex(dir); IndexReader reader = IndexReader.open(dir); IndexReader reader2 = reader.reopen(); reader.close(); reader2.terms(); // AlreadyClosedException - this IndexReader

SpanNearQuery with repeated term?

2011-04-01 Thread Gregory Tarr
I am having some issues with SpanNearQuery: SpanQuery[] clauses = new SpanTermQuery[2]; Clauses[0] = new SpanTermQuery("text",""); Clauses[1] = new SpanTermQuery("text",""); SpanNearQuery q = new SpanNearQuery(clauses,0,true); // returns 1 document with " " in it SpanQuery[] claus

RE: SpanNearQuery with repeated term?

2011-04-01 Thread Gregory Tarr
r 1, 2011 at 11:30 AM, Gregory Tarr wrote: > I am having some issues with SpanNearQuery: > > SpanQuery[] clauses = new SpanTermQuery[2]; Clauses[0] = new > SpanTermQuery("text",""); Clauses[1] = new > SpanTermQuery("text",""); SpanNea

RE: SpanNearQuery with repeated term?

2011-04-01 Thread Gregory Tarr
Sorry, I have got this working now. It was a silly mistake. -Original Message- From: Gregory Tarr [mailto:gregory.t...@detica.com] Sent: 01 April 2011 12:13 To: java-user@lucene.apache.org Subject: RE: SpanNearQuery with repeated term? Sorry I am using 2.9.4, which is the same as 3.0.3

SpanNearQuery - inOrder parameter

2011-05-09 Thread Gregory Tarr
I attach a junit test which shows strange behaviour of the inOrder parameter on the SpanNearQuery constructor, using Lucene 2.9.4. My understanding of this parameter is that true forces the order and false doesn't care about the order. Using true always works. However using false works fine when

RE: SpanNearQuery - inOrder parameter

2011-05-09 Thread Gregory Tarr
setting inOrder = false q = new SpanNearQuery(clauses, 0, false); searcher.search(q, collector); // This assert fails - 3 docs are returned. Expecting only DOC2 Assert.assertEquals("Check 1 result", 1, collector.getTotalHits()); } } From: Gregory

RE: SpanNearQuery - inOrder parameter

2011-05-10 Thread Gregory Tarr
Anyone able to help me with the problem below? Thanks Greg -Original Message- From: Gregory Tarr [mailto:gregory.t...@detica.com] Sent: 09 May 2011 12:33 To: java-user@lucene.apache.org Subject: RE: SpanNearQuery - inOrder parameter Attachment didn't work - test below: i

RE: SpanNearQuery - inOrder parameter

2011-05-13 Thread Gregory Tarr
Chris, and others Thanks for your reply. In effect what you are saying is that SpanNearQuery works as expected, and I should set inOrder=true to obtain the behaviour I require, even though I don't care about the order? Thanks Greg -Original Message- From: Chris Hostetter [mailto:hossma

RE: SpanNearQuery - inOrder parameter

2011-05-17 Thread Gregory Tarr
Anyone else able to reply to this? Thanks Greg -Original Message- From: Gregory Tarr Sent: 13 May 2011 15:46 To: 'java-user@lucene.apache.org' Subject: RE: SpanNearQuery - inOrder parameter Chris, and others Thanks for your reply. In effect what you are saying is that Spa

RE: SpanNearQuery - inOrder parameter

2011-05-19 Thread Gregory Tarr
preventing you from specifying in-order? Doron On Tue, May 17, 2011 at 12:56 PM, Gregory Tarr wrote: > Anyone else able to reply to this? > > Thanks > > Greg > > -Original Message- > From: Gregory Tarr > Sent: 13 May 2011 15:46 > To: 'java-user@lucene.