: Now, I know how to work-around this, by appending some unique character 
: sequence at each end of the field and then include this in my search in 
: the front end. However, I wonder if any of you have been planning a 
: patch to add a native boundary match feature to Solr that would 
: automagically add tokens (also for multi-value fields!), and expand the 
: query language to allow querying for starts-with(), ends-with() and 
: equals()

well, if you *always* want boundary rules to be applied, that can be done 
as simply as adding your boundary tokens automaticly in both the index and 
query time analyzers ... then a search for q="New York" can 
automaticly be translated into a PhraseQuery for "_BEGIN New York _END"

If you want special QueryParser markup to specify when you wnat specific 
boundary conditions that can also be done with a custom QParser, and 
automaicly applying the boundry tokens in your indexing analyzer (but not 
the query analyzer -- the QParser would take care of that part)  In 
general though it's hard to see how something like q=begin(New York) is 
easier syntax then q="_BEGIN New York"

THe point is it's realtively easy to implement something like this when 
meeting specific needs, but i don't know of any working on a truely 
generalized Qparser that deals with this -- largely because most people 
who care about this sort of thing either have really complicated use cases 
(ie: not just begin/end boudnary markers, but also want sentence, 
paragraph, page, chapter, section, etc...) or want extremely specific 
query syntax (ie: they're trying to recreate the syntax of an existing 
system they are replacing) so a general solution doesn't work well.

The cosest i've ever seen is Mark Miller's QSolr parser, which actually 
went a completley differnet direction using a home grown syntax to 
generate Span queries ... if that slacker ever gets off his butt and 
starts running his webserver again, you could download it and try it out, 
and probably find that it would be trivial to turn it into a QParser.


-Hoss

Reply via email to