I think you're going to have trouble doing this with seperate cores. With seperate cores, you'll need to issue two querries to solr, one for each core. And then to intermingle results from the differnet cores like that, it's going to require difficult (esp to do at all efficiently) client side code. Different cores really are entirely seperate.

If you put everything in the same core, but with different solr fields used, it will be easier to intermingle. Conceptually, think of all the documents you were thinking of as being indexed in 'core1' as being just in the single core, but having their text indexed in a field called, say, "text_core1". Then the 'core2' documents are in that same core actually, but indexed under "text_core2".

Now if you just wanted results from core1 followed by results from core2, you could use dismax and boost the core1 field a lot, something like:

text_core1^1000   text_core2

Then we add in your requirement for "exact matches" first. You need to be more precise about what you mean by "exact" matches and "partial" matches. By "exact" do you mean phrase searching? Do you mean it must match the entire field exactly start to finish? Do you mean un-stemmed, where "partial" is stemmed?

Once you figure this out, one possible way to approach it is to set up a solr field with analyzers such that it will only match "exact" matches. For instance, if you really mean exact string match without any tokenization, you could use the KeywordTokenizer. If you are able to set up a solr field like this, then again using dismax, the solution is straightforward, something like:

qf=text_core1_exact^3000 text_core2_exact^2000 text_core1_partial^1000 text_core2_partial

Hope this helps you think about how to approach your problem.

Jonathan

Balaji.A wrote:
Hi All,
   I have a specific requirement as stated below. Kindly suggest if this can
be acheived or not and the steps to acheive it.

I have 2 cores storing different kind of data.

My search query should return results in the below given order

1) Exact match resutls from core1
2) Exact match results from core2
3) Partial match results from core1
4) Partial match results from core2

Note: I don't want exact match results to be duplicated in Partial match
results.

Please suggest!

Thanks.

Reply via email to