lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pasha Bizhan" <>
Subject RE: "Advanced" query language
Date Sat, 03 Dec 2005 20:18:40 GMT

> From: Erik Hatcher [] 

> >    <MoreLikeThis minNumberShouldMatch="3"
> > maxQueryTerms="30">
> We're back to MoreLikeThis - it's not currently a Query subclass.   
> How do you envision this sort of thing fitting in if it's not a Query?

But MoreLikeThis class produces a Query. It's similar to google "define:"
I think goolge handle such queries and then redirect search to somewhere. 
And QueryParser can handle such searches too and use an alternative logic to
create Query.

For example, we can extend the QueryParser by special (syntax) handlers
which will be create the Query.

Something lke this:
	class LikeHandler {};
	LikeHandler likeHandler = new LikeHandler(...);	
	string queryString = "like:(red quick fox)"; 
	Query q = QueryParser.parse(queryString, analyzer, likeHandler);

QueryParser scan the input, find special command (like:) and then find the
handler for this command.
If the handler exists the QP call it to create the Query.

Disadvantages are present.

Pasha Bizhan

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

View raw message