Hi Cory I think the best approach in this case is to just use a normal SQL query, and add a database index on that varchar column. What you're requesting isn't an option for Sphinx, beyond something like you've already tried (but if you were going down that path, you could put spaces between DELIMITER and the query, and then do a phrase match, it will still do the job, and you'll likely get the advantages of stemming).
Cheers -- Pat On 27/01/2009, at 6:13 AM, bantic wrote: > > Is it possible to use Sphinx to search and only return things that > match the document exactly? We are using it to basically do an > existence search on a large table of restaurant names, and we only > want results that match the full restaurant name exactly. > > For instance, here's how we *want* it to work: > - Index contains "old town spaghetti restaurant" and "spaghetti > restaurant" > - Search for: "spaghetti" should return *nothing* > - Search for: "spaghetti restaurant" should return *only* the > "spaghetti restaurant" document, not both documents. > > If I try this now, both of the searches above will return all the (2) > results. > > We've tried using a delimiter when building the index, so that the > name that we index becomes "DELIMITERspaghetti restaurantDELIMITER", > and then our query code adds the "DELIMITER" string to both sides of > its query, but this is a bit of an ugly hack, and if we decide down > the road to take advantage of stemming or any of the more > sophisticated featured in sphinx's query language, we'll be out of > luck. > > Does anyone have any suggestions? I basically want to do the > equivalent of a regex expression with the ^ and $: /^query$/ > > thanks, > Cory > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en -~----------~----~----~----~------~----~------~--~---
