0

When performing these queries (separately):

country:IN

-or-

country:IT

-or-

country:IS

... I get all items in the index returned. I want to get only the items whose country field matches those params. I've tried every combination of escaping with single/double quotes and single/double slashes. When doing so, no items are returned at all.

I've verified that items exist in the index for these params by dumping the whole index (with a loose query) and identifying them. I'm on django-haystack in case that matters, but the issue is there for both the Django python shell and the Solr web admin interfaces.

Thanks for any help!

jeffcole
  • 3
  • 2

2 Answers2

1

Filter queries return a subset of documents that match them.

fq=country:(IN OR IT OR IS)
fq=country:IN
Jesvin Jose
  • 22,498
  • 32
  • 109
  • 202
0

Those are standard noise / stop words. You can either remove the terms from the stopwords file (stopwords_en.txt) and redindex your documents. Or set the type to string and use fq like aitchnyu mentions above.

d whelan
  • 804
  • 5
  • 8
  • Because I didn't want to remove these noise words, what I ended up doing was converting the country abbreviations (India, Italy, Iceland) to their full names at the haystack index creation level. Then, when reading out of the index, I converted back to the abbreviations for use by the web app. – jeffcole May 21 '12 at 17:57