You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by karl wettin <ka...@snigel.net> on 2006/04/14 16:27:15 UTC

query analysis

Hello list,

I want to know if a human written query passed through the  
QueryParser is "clean" from fields, boolean clauses and query  
indicators. Easy way out would of course to add a boolean that resets  
at ReInit(), but maybe there is a smart way to do it. Perhaps it is  
possible to treat the retuned Query as a composite pattern (i.e.  
query.iterateNonRewrittenParts())?

The plan is to avoid making suggestions on meta data in the query.  
"+name:foo" should suggest on "foo" only, and not "+name:foo". I  
initially tried to work the enumerateTerms, but realised this is  
hopeless(?) as a rewritten query looks quite different.

Perhaps I'm attacking this from the wrong angle?

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


Re: query analysis

Posted by Chris Lu <ch...@gmail.com>.
Sorry, really misunderstood you. And you already know Lucene a lot. :)

Basically you want to restore the original query from the Query
object. But it may have already passed a lot of composition, like
Boolean, Span, Wildcard.

I don't feel it's possible to reconstruct the original human query.

Chris Lu
---------------------------------------
Full-Text Lucene Search on Any Databases
http://www.dbsight.net
Faster to Setup than reading marketing materials!


On 4/14/06, karl wettin <ka...@snigel.net> wrote:
>
> 14 apr 2006 kl. 17.41 skrev Chris Lu:
> >
> > On 4/14/06, karl wettin <ka...@snigel.net> wrote:
>
> >> I want to know if a human written query passed through the
> >> QueryParser is "clean" from fields, boolean clauses and query
> >> indicators. Easy way out would of course to add a boolean that resets
> >> at ReInit(), but maybe there is a smart way to do it. Perhaps it is
> >> possible to treat the retuned Query as a composite pattern (i.e.
> >> query.iterateNonRewrittenParts())?
>
> > tried MultiFieldQueryParser?
>
> How do you mean that it can help? I'm not sure if you understood my
> question or if MultiFieldQueryParser has some features I'm unaware of.
>
> ---------------------------------------------------------------------
> 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


Re: query analysis

Posted by karl wettin <ka...@snigel.net>.
14 apr 2006 kl. 17.41 skrev Chris Lu:
>
> On 4/14/06, karl wettin <ka...@snigel.net> wrote:

>> I want to know if a human written query passed through the
>> QueryParser is "clean" from fields, boolean clauses and query
>> indicators. Easy way out would of course to add a boolean that resets
>> at ReInit(), but maybe there is a smart way to do it. Perhaps it is
>> possible to treat the retuned Query as a composite pattern (i.e.
>> query.iterateNonRewrittenParts())?

> tried MultiFieldQueryParser?

How do you mean that it can help? I'm not sure if you understood my  
question or if MultiFieldQueryParser has some features I'm unaware of. 

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


Re: query analysis

Posted by Chris Lu <ch...@gmail.com>.
tried MultiFieldQueryParser?

Chris Lu
---------------------------------------
Full-Text Lucene Search on Any Databases
http://www.dbsight.net
Faster to Setup than reading marketing materials!

On 4/14/06, karl wettin <ka...@snigel.net> wrote:
> Hello list,
>
> I want to know if a human written query passed through the
> QueryParser is "clean" from fields, boolean clauses and query
> indicators. Easy way out would of course to add a boolean that resets
> at ReInit(), but maybe there is a smart way to do it. Perhaps it is
> possible to treat the retuned Query as a composite pattern (i.e.
> query.iterateNonRewrittenParts())?
>
> The plan is to avoid making suggestions on meta data in the query.
> "+name:foo" should suggest on "foo" only, and not "+name:foo". I
> initially tried to work the enumerateTerms, but realised this is
> hopeless(?) as a rewritten query looks quite different.
>
> Perhaps I'm attacking this from the wrong angle?
>
> ---------------------------------------------------------------------
> 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