lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Hadfield <>
Subject Re: query across fields?
Date Mon, 10 Oct 2005 22:45:35 GMT
Thanks Doug -

I'll give Span Query's a try as they can handle the 0 increment issue.

My original desire to have more than one field comes from my document 
represention which includes multiple fields containing (the same) 
document text using different stemmers, as, depending on the type of 
query, i may need to use results from a different stemmer. this is 
necessary as we index text containing complex biological names and some 
otherwise useful stemming chokes on the names.

So, although my immediate need is met, I would still be interested in 
considering how cross-field queries might work.


Doug Cutting wrote:

> Marc Hadfield wrote:
>> I actually mention your option in my email:
>>> In principle I could store the full text in two fields with the 
>>> second field containing the types without incrementing the token 
>>> index.   Then, do a SpanQuery for "Johnson" and "name" with a 
>>> distance of 0.  The resulting match would have a token position 
>>> which would refer back to the matching position in the first field.  
>>> I don't know if this is a really good idea.
>> ie Field_B = full text interlaced with "types" following each full 
>> text token with positionIncrement=0
> Sorry, you confused me when you spoke of this as "two fields" when 
> only one field is required.
>> However, as far as I understand, the standard TermQuery won't let me 
>> check if "Johnson" and "__name__" occur at the **same** position.  
>> Perhaps, as I ask above, a SpanQuery will allow multiple terms with a 
>> distance of zero (0) , that is they were indexed with 
>> positionIncrement=0 and SpanQuery can handle 0 distance terms?
> TermQuery certainly won't, since it only concerns a single term.  But 
> PhraseQuery now has an add(Term, position) method that should do the 
> trick.  And SpanNearQuery should work.
> Doug
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message