user438454534
user438454534

Reputation: 3689

SOLR search array vs individual documents

I've got a business case where I need to check if the search query is about displays businesses

eg: q="night clubs new york"

I've got a list of Countries, state city and region in my database 3million + records and I've got a list of business categories.

All I want to do is check if in the query has a business category in it (night clubs) and does it have a City, state or country's name (new york). So i'm checking the number of results retuned for the below query. If I get 2 numResults then this is a business query and then I query my Solr index to search for businesses.

query: places_ss:(night clubs new york) OR categories_ss:(night clubs new york)

Speed Question: How should I save the list of cities, states and countries in SOLR to get maximum search speed ?

Would it be a good idea to have a separate core just for above place documents to increase speed ?

Is this a good solution ?

Upvotes: 1

Views: 197

Answers (1)

jeorfevre
jeorfevre

Reputation: 2316

Document organisation : better to have a document approche with : - location - activity - other things needed!

location You should save your location like this Country:state:city:suburb.... so that you can seach in usa:new york:new york* of ::new york

No need for _ avoid that, there is no needs !

activity activity should be stored in another field for precision on the search and speed.

Upvotes: 0

Related Questions