Erik,

On Saturday 19 February 2005 01:33, Erik Hatcher wrote:
> 
> On Feb 18, 2005, at 6:37 PM, Paul Elschot wrote:
> 
> > On Friday 18 February 2005 21:55, Erik Hatcher wrote:
> >>
> >> On Feb 18, 2005, at 3:47 PM, Paul Elschot wrote:
> >>
> >>> Erik,
> >>>
> >>> Just curious: it would seem easier to use multiple fields for the
> >>> original case and lowercase searching. Is there any particular reason
> >>> you analyzed the documents to multiple indexes instead of multiple
> >>> fields?
> >>
> >> I considered that approach, however to expose QueryParser I'd have to
> >> get tricky.  If I have title_orig and title_lc fields, how would I
> >> allow freeform queries of title:something?
> >
> > By lowercasing the querytext and searching in title_lc ?
> 
> Well sure, but how about this query:
> 
>       title:Something AND anotherField:someOtherValue
> 
> QueryParser, as-is, won't be able to do field-name swapping.  I could 
> certainly apply that technique on all the structured queries that I 
> build up with the API, but with QueryParser it is trickier.   I'm 
> definitely open for suggestions on improving how case is handled.  The 

Overriding this (1.4.3 QueryParser.jj, line 286) might work:

protected Query getFieldQuery(String field, String queryText)
throws ParseException { ... }

It will be called by the parser for both parts of the query above, so one
could change the field depending on the requested type of search
and the field name in the query.

> only drawback now is that I'm duplicating indexes, but that is only an 
> issue in how long it takes to rebuild the index from scratch (currently 
> about 20 minutes or so on a good day - when the machine isn't swamped).

Once the users get the hang of this, you might end up having to quadruple
the index, or more.

Regards,
Paul Elschot


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to