Re: thinking about the pronunciation of lucene

2005-09-23 Thread James Huang
I'm having trouble figuring that out ... I pronounced "lu-CENE", and I've heard people who didn't know it pronounce the same way. But, I got "corrected" into "LOO-sen" one time. Any concensus? --- [EMAIL PROTECTED] wrote: > Thank you for your answer! > I know the people in Germany pronounce it

Re: Example ....Lucene with Java Server Pages?

2005-09-21 Thread James Huang
out of > your JSP. :) > > You are right, IndexSearchers are meant to be > reused. When the index > changes, you need to open a new one, if you want to > see the changes. > > Otis > > --- James Huang <[EMAIL PROTECTED]> wrote: > > > That demo (results.jsp)

Re: Example ....Lucene with Java Server Pages?

2005-09-21 Thread James Huang
That demo (results.jsp) opens a IndexSearcher per each request, which I deem not really the right way of using Lucene in a web app. I used jspInit() to initiate a servlet-wide instance: <%! IndexSearcher searcher = null; public void jspInit() { searcher = ...; } %> Still not comp

Re: Sort by relevance+distance

2005-09-19 Thread James Huang
Cool! Only one question: if we have class RelevanceAndDistanceCollector extends HitCollector { public ScoreDoc[] getMatches(int start, int size) { ... } } and a call of getMatches(1, 25); would not cache as many as 1+ docs, would it? Remember this is the whole point o

Re: Sort by relevance+distance

2005-09-19 Thread James Huang
I think this is probably the closest thing I like to/am able to do now. If I ever get to do this, I'll share the idea/code and seek review and suggestions. Thank you very much, Mark, and all others that have helped! -James mark harwood <[EMAIL PROTECTED]> wrote: I think the HitCollector appro

Re: Sort by relevance+distance

2005-09-18 Thread James Huang
--- Jeff Rodenburg <[EMAIL PROTECTED]> wrote: > trimming the post further: > > On 9/18/05, James Huang <[EMAIL PROTECTED]> wrote: > > > > >The problem is quite generic, I believe. What I > like to do is similar to > > LIA-ch6, i.e. to find a "

Re: Sort by relevance+distance

2005-09-18 Thread James Huang
See comments below. --- Erik Hatcher <[EMAIL PROTECTED]> wrote: > [trimming the post a bit] > > On Sep 18, 2005, at 11:51 AM, James Huang wrote: > > The problem is quite generic, I believe. What I > like > > to do is similar to LIA-ch6, i.e. to find a "good

Re: Sort by relevance+distance

2005-09-18 Thread James Huang
--- Erik Hatcher <[EMAIL PROTECTED]> wrote: > > On Sep 18, 2005, at 10:24 AM, James Huang wrote: > > > --- Erik Hatcher <[EMAIL PROTECTED]> > wrote: > > > > > >> Get back to using your DistanceComparatorSource, > and > &g

Re: Sort by relevance+distance

2005-09-18 Thread James Huang
--- Erik Hatcher <[EMAIL PROTECTED]> wrote: > Get back to using your DistanceComparatorSource, and > couple that with > a SortField.FIELD_SCORE, like this: > > Sort sort = new Sort(new SortField[] {new > SortField("location", > new DistanceComparatorSource( you need>)), > SortField.F

Re: Sort by relevance+distance

2005-09-17 Thread James Huang
rmance (and cleaner code). Previously, I have created a DistanceComparatorSource (similar to that in LIA-ch6); sorting by distance works but relevance is lost. -James --- Erik Hatcher <[EMAIL PROTECTED]> wrote: > > On Sep 17, 2005, at 4:10 PM, James Huang wrote: > > > Hi, > >

Re: Sort by relevance+distance

2005-09-17 Thread James Huang
I guess I can use HitCollector and implement my own sorting, right? Is there a better approach? --- James Huang <[EMAIL PROTECTED]> wrote: > Hi, > > I can sort the search results by distance now. But, > the relevance is lost. > > I like to have the results sorted b

Sort by relevance+distance

2005-09-17 Thread James Huang
Hi, I can sort the search results by distance now. But, the relevance is lost. I like to have the results sorted by relevance + distance, i.e., relevance first; for results of similar relevance, order by distance. How to do that? Thanks a lot in advance! -James --- James Huang <[EM

Re: Question: force a field must be matched?

2005-09-15 Thread James Huang
Yes, "+" is what I missed! Thanks. Suppose there is a book published by 3 publishers (I don't know how that works in real world): // At index time: doc.add( Field.Keyword("publisher", "Manning") ); doc.add( Field.Keyword("publisher", "SAMS") ); doc.add( Field.Keyword("publisher", "O'Reilly"

Re: Question: dynamic sorting

2005-09-15 Thread James Huang
classes that will let you write a custom sorter. > If you have a copy > of LIA, look at chapter 6 for an example ( > http://www.lucenebook.com/search?query=custom+sort+section%3A6* > ) > > Otis > > --- James Huang <[EMAIL PROTECTED]> wrote: > > > Suppos

Re: Question: force a field must be matched?

2005-09-15 Thread James Huang
Thanks Jason. I wonder if that's the same as queryString + " publisher:Manning" and pass on to the query parser? -James --- Jason Haruska <[EMAIL PROTECTED]> wrote: > On 9/15/05, James Huang <[EMAIL PROTECTED]> wrote: > > > > Suppose I have a

Question: dynamic sorting

2005-09-15 Thread James Huang
Suppose I have a book index with field="publisher", field="title", etc. If a user has bought Manning books, then I like to sort the result with Manning books listed first. In essence, I'm asking for a parameterized custom sorting. Is there a way to do this? Thanks, -James -

Question: force a field must be matched?

2005-09-15 Thread James Huang
Suppose I have a book index with field="publisher", field="title", etc. I want to search for books only from "Manning", do I have to do anything special? how? Thanks, -James __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protectio