好吧,我正在制作一个算法,在此之前我必须了解当 solr 必须在它们之间进行 AND 时如何处理结果。
So Consider a scenario
id Country City
1 India Bangalore
2 America New York
3 France Paris
4 America Los Angeles
现在假设我的查询是 country = America 和 city = Los Angeles .. 现在 solr 会像这样工作吗?
Take all Ids for country = America i.e Id (2 , 4)
Then take all Ids for City = Los Angeles i.e (4)
Then Find common in both result set i.e (4).
如果它是解决 AND 的方法,那么它的复杂性不高。如果我们有更多的 AND 甚至太高了。
谁能说清楚我的疑惑。
编辑:显示用例清楚地描述了我的要求。
Id(unique) returnMe desc name value
1 user1 all those living in usa country USA
2. user2 all those like game game football
3. user1 my hobbies are hobby guitar
现在我怎样才能得到 returnMe 以下查询?
1. For all those users who live in usa AND hobby is guitar.
2. For all those users who live in usa OR game is football.
Answer for query first should be user1
Answer for query second should be user1 and user2
谢谢