lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Elschot <paul.elsc...@xs4all.nl>
Subject Re: a "real" PhrasePrefixQuery
Date Fri, 20 May 2005 18:50:07 GMT
On Friday 20 May 2005 17:20, Terry Steichen wrote:
> Paul,
> 
> Could you flesh out the implementation you describe below with some code 
> or pseudocode?

You can start from this:
http://issues.apache.org/bugzilla/show_bug.cgi?id=34331
and use code from the method in src/java
org.surround.search.SpanNearClauseFactory.makeSpanNearClause()
and from the classes SrndPrefixQuery and SimpleTerm.

But it's probably easier to start from the javadocs of the 
org.apache.lucene.search.span package and the java code
from the 1.4.3 PrefixQuery.

Have a nice weekend,
Paul Elschot

> Regards,
> 
> Terry
> 
> 
> Paul Elschot wrote:
> 
> >On Friday 20 May 2005 11:30, Stanislav Jordanov wrote:
> >  
> >
> >>Is there a Lucene Query (or something that will do a job) like:
> >>"Star Wars tri*"
> >>
> >>that will match all docs containing a 3 word phrase: 'Star' followed by 
> >>'Wars' followed by a word starting with 'tri'.
> >>
> >>I.e. the above query will match both "Star Wars trilogy" and "Star Wars 
> >>triumph".
> >>    
> >>
> >
> >You'll need an ordered SpanNearQuery over the following:
> >- SpanTermQuery for "Star"
> >- SpanTermQuery for "Wars"
> >- SpanOrQuery over all SpanTermQuery's for terms matching tri*.
> >
> >The last one should be a SpanPrefixQuery, but that one is not
> >available. Have a look in PrefixQuery.rewrite() on how to find all
> >terms matching tri*, it's fairly straightforward.
> >
> >Regards,
> >Paul Elschot
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> >For additional commands, e-mail: java-user-help@lucene.apache.org
> >
> >
> >  
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 
> 
> 


---------------------------------------------------------------------
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