Re: Partial / starts with searching

2009-02-13 Thread Robert Muir
have you looked at perfieldanalyzerwrapper? This analyzer is used to facilitate scenarios where different fields require different analysis techniques... i'm using it for a few things and haven't had any issues. agree filters might be better but if you want a quick fix... On Fri, Feb 13, 2009 at

Re: Partial / starts with searching

2009-02-13 Thread d-fader
Thanks, I will. It might take a while, but I'll post my findings. Erick Erickson wrote: *really* think about using Filters here for the user permissions. I think you'd be surprised how quickly you could construct one, and depending upon how many users you have you might be able to get some benef

Re: Partial / starts with searching

2009-02-13 Thread Erick Erickson
*really* think about using Filters here for the user permissions. I think you'd be surprised how quickly you could construct one, and depending upon how many users you have you might be able to get some benefit from CachingWrapperFilter. And ignore my entire diatribe about whether you can restrict

Re: Partial / starts with searching

2009-02-13 Thread d-fader
Hi Erick, Thanks for your pretty 'extensive' reaction. I read it quickly and I have to read it more thoroughly before I can give a meaningful response, so I'll check-out the discussions and I'll try to apply your idea's and then I'll post my findings. Can take a while though, I'm pretty busy

Re: Partial / starts with searching

2009-02-13 Thread d-fader
Well, it worked. I indexed a test database and it indeed grew somewhat (from 16 MiB to 200 MiB :)), and it works flawlessly. Still, I can't use the result in my application :) The 'live' index database contains about 2 million documents and is used by a multi-user application. As you probably ca

Re: Partial / starts with searching

2009-02-13 Thread Erick Erickson
Surprisingly, I found that constructing Filters was surprisingly fast for partial queries, you might want to give that a spin. See the Filter class, which is unrelated to any of the TokenFilter-derived classes . The basic idea here is to use, say, WildCardTermEnum or RegexTermEnum (in my experien

Re: Sorting by relevance and a field

2009-02-13 Thread Michael McCandless
SortField.FIELD_SCORE lets you sort by relevance. So then make a Sort that contains an array of two SortFields, eg: new Sort(new SortField[] {SortField.FIELD_SCORE, new SortField(myField)}) and pass that when searching. Lucene will then sort first by score, and when there are ties, sec

Sorting by relevance and a field

2009-02-13 Thread Yannick Caillaux
Hi all, Lucene sorts by decreasing relevance by default. The SortField class is used for sorting by lucene field(s). First I must sort by relevance, then (for the results which have the same relevance) I must sort by a lucene field (title for example). I don't know how to do that. Someone can

Re: Partial / starts with searching

2009-02-13 Thread Karl Wettin
If you attach an NgramTokenFilter to your analyzer at index and query time you should be able to query for parts of the word. http://lucene.apache.org/java/2_4_0/api/org/apache/lucene/analysis/ngram/NGramTokenFilter.html http://lucene.apache.org/java/2_4_0/api/index.html?org/apache/lucene/analy

Re: Partial / starts with searching

2009-02-13 Thread d-fader
Karl, As a matter of fact I more or less did. I'm not really into NGrams, but I read some articles about this technique and I eventually ended up at the 'Did you mean: Lucene?' article written by Tom White. To make a long story short, this solved my problem partially. I do have 2 indexes now

Re: Partial / starts with searching

2009-02-13 Thread Karl Wettin
Hi again Jori, did you try N-grams as suggested in the reply on -dev? karl 13 feb 2009 kl. 09.05 skrev d-fader: Hi, I've actually posted this message in de dev mailing list earlier, because I though my 'issue' is a limitation of the functionality of Lucene, but they redirected me to th

Partial / starts with searching

2009-02-13 Thread d-fader
Hi, I've actually posted this message in de dev mailing list earlier, because I though my 'issue' is a limitation of the functionality of Lucene, but they redirected me to this mailinglist, so I hope one of you guys can help me out :) Maybe the 'issue' I'm addressing now is discussed thouroughly