Search code examples
solrfilterfacetlarge-data

how solr filter large set of ids


I got two tables, one is news, the other is contact.

news: newsid, news_content, news_orgid

contact: contactid, contact_orgid

I indexed these two tables in solr, so i have two cores. but i have a use case that i need to find out all contactids by news_content. I get a large set of orgids from news index first, approximate 1 million. I want to use it as a filter query in solr to search, like

select?q=:&fq=id:100+id:101+id:102+id:103+id:104

but solr has a limit of 1024 boolean queries. So i can't transfer in one process. Is there another ways to fix this?

Because i want to use solr's facet data, i can't search all data in solr and compare with the ids.

Appreciate your help!

Best Regards! Rick.


Solution

  • I solve this problem with solr4.0 new feature: join. First i put contact and news in one core, as http://searchhub.org/2011/02/12/solr-powered-isfdb-part-4/ , then we can join with orgids