lucene-java-user mailing list archives

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

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:

while...
   SpanTermQuery stquery = new SpanTermQuery(new Term("x", termStr[incFactor]));
   query = new SpanFirstQuery(stquery, incFactor);
   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.

Antony






---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message