search - filtering results in solr -
i'm trying build auto suggest functionality using solr. index contains different locations within city , looks like
id: unique id name: complete name type: can 1 of 'location_zone', 'location_subzone', 'location_city', 'outlet', 'landmark' ... city: city id now when user types something, want return suggestion current city , of type location_*. similar where city_id = 1 , type="location_%" in sql.
i guess 1 way faceting right way? still search in documents , filter results or apply condition first mysql it
ps: i'm new solr , appreciate if can point out mistakes in approach
solr provide filtering, using fq parameter. you're looking should along lines of:
&fq=city_id:1&fq=type:location_*&q=... this page illustrates how , when use filter queries in solr.
Comments
Post a Comment