Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different behaviour of embedded Solr vs Solr container? #863

Closed
icarito opened this issue Jun 16, 2017 · 6 comments
Closed

Different behaviour of embedded Solr vs Solr container? #863

icarito opened this issue Jun 16, 2017 · 6 comments

Comments

@icarito
Copy link

icarito commented Jun 16, 2017

Hi,
We are PublicLab.Org appreciate Sunspot and are in the process of deploying it to production.

Our testing and development was done with the embedded Solr engine found in sunspot_solr (2.2.6) gem.

Now for production we are using a Solr 5.3 container (as found in https://hub.docker.com/_/solr/). In this case, the default Sunspot query is not recognized by the Solr service , specifically, the parameters qf=title_text+body_text+comment_text and defType=edismax cause Solr to not return any results.

Adjusting these parameters for production, causes results to break in development (the embedded Solr).

Thanks for your guidance!

@jywarren
Copy link

Quick edit; those parameters cause Solr to return only some results and not others. -- we get some hits, but very spotty, and miss a lot of content. If either of those parameters are removed (in a manual query from the Solr web console) -- such as qf='' or actually fully removing defType=edismax -- the search succeeds and we get full expected results.

@jywarren
Copy link

@jywarren
Copy link

It seems that the default sunspot gem query only returns an exact, case-sensitive match of the title field. For example:

So, either we need to

a) figure out why the seemingly well-formed sunspot-generated query only matches exact title text and change that, OR
b) figure out why our manual edits to the query return nothing at all in embedded (sunspot gem) Solr

@jywarren
Copy link

When using edismax, qf= seems not to be behaving as we'd expect it to based on the edismax docs or common Solr queries docs.

The sunspot source seems to track those pretty well:

params[:qf] = @fulltext_fields.values.map { |field| field.to_boosted_field }.join(' ')

And I am attempting (in Solr console) the same difference without sunspot involved at all:

/solr/default/select?wt=json&indent=true&fq=type:Node&q=balloon&fl=*%20score&qf=title_text%20body_text%20comment_text&defType=edismax

returns nothing, while

/solr/default/select?wt=json&indent=true&fq=type:Node&q=balloon&fl=*%20score&qf=title_text%20body_text%20comment_text

returns full results.

@jywarren
Copy link

Just a follow-up; we've ended up switching away from the embedded Solr provided in the sunspot_solr gem on Rails, and using a containerized (and more up-to-date) Solr. This has bypassed the issue, though not really solved it.

@icarito
Copy link
Author

icarito commented Jul 17, 2017

Actually, @jywarren we did figure this out! It turns out that the Solr engine needs the "Sunspot configsets" which, in the case of the container, need to be loaded as a volume.
In this commit, we included the configset and setup the container to pre-build the core from this configuration. After doing this, tests of both container and gem-embedded Solr coincide. It was hard to figure out, so worth leaving a comment for posterity here.
This one reference helped figure it out: https://www.norconex.com/use-solr-5-with-docker/
Regards!

@icarito icarito closed this as completed Jul 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants