lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Smith <psm...@aconex.com>
Subject Re: "Starts with" query?
Date Fri, 06 Jan 2006 00:01:31 GMT
first off response to my own post, I meant PhraseQuery instead.

But, since we're only tokenizing this field ,and not storing the  
entire contents of the field, I'm not sure this is ever going to  
work, is it?

I notice that if I have a title "auto update", then the phrase query  
trick works if it searches on

	title:"0start0 auto*"

but does not find any matches for

	title:"0start0 aut*"

I'm a bit stuck.

Paul

On 06/01/2006, at 10:43 AM, Paul Smith wrote:

>> 2) index a magic token at the start of the title and include that  
>> in a
>> phrase query:
>>    "_START_ the quick"
>
> Ok, I've gone and chose "0start0" as my start token, because our  
> analyzer is stripping _.
>
> Now, second dumb question of the day, give the search for starts  
> with "The qui*", that has to be turned into a prefix query, like so?
>
> new PrefixQuery(new Term("title", "0start0 " +  "The qui"))
>
> Is that the right approach?  To always prefix the search term  
> string with the magic start text?
>
> I ask this because I'm getting weird results in my search now, as  
> all documents are being matched.  When the query is finally run, it  
> looks like this:
>
> +(orgid:7 publicflag:1 sharedorgid:7) +isregistered:1  
> +title:'0start0 f'* +cversion:1
>
> (you can ignore all but the title field in this case, the rest is  
> correct for our app).
>
> Paul
>
> ---------------------------------------------------------------------
> 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