Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exact search (double quotes) ignored #23

Open
lguariento opened this issue Oct 14, 2015 · 1 comment
Open

Exact search (double quotes) ignored #23

lguariento opened this issue Oct 14, 2015 · 1 comment

Comments

@lguariento
Copy link

I have a weird problem. I'm querying a Solr 5.3 instance with Django through Scorched. It all works great as far as I don't ask an exact-match query. In other words,

q=something something else

returns exactly the same result as:

q="something something else"

The culprit, as far as I can see, is the actual query which Django throws at Solr. In fact, for the second case this is:

q="something+something+else"

So, in other words, the " character is escaped. Am I right? How do I tell Solr that when I query something between double quotes I want an exact match?

In the Solr admin webpage it all works well, i.e. if I search for "something something else" I get the correct result.

I'm not sure this is a Scorched problem or not. Does it have something to do with filters/tokenizers (e.g. solr.MappingCharFilterFactory)?

@mehaase
Copy link
Contributor

mehaase commented Dec 19, 2015

Try this:

from scorched.strings import DismaxString
...
solr.query(q=DismaxString('"something something else"')

Scorched will not escape any characters inside a DismaxString.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants