lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony Bowesman <>
Subject Positions in SpanFirst
Date Wed, 21 Feb 2007 11:11:28 GMT

I have a field to which I add several bits of information, e.g.

doc.add(new Field("x", "first bit"));
doc.add(new Field("x", "second part"));
doc.add(new Field("x", "third section"));

I am using SpanFirstQuery to search them with something like:

   SpanTermQuery stquery = new SpanTermQuery(new Term("x", termStr[incFactor]));
   query = new SpanFirstQuery(stquery, incFactor);

but a search for

"first", span pos 1
"bit", span pos 2

gets a match, but

"second", span pos 1
"part", span pos 2

fails.  How can I get the first term position for each word in each Field added 
to the document for the same field name to be 1, so that the SpanFirst works.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message