Closed (fixed)
Project:
Search API Solr
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Oct 2018 at 13:13 UTC
Updated:
13 Mar 2019 at 19:03 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mkalkbrennerCan you provide some more details about your setup?
Solr version, cloud or single core, ...
Are you sure that Solr uses your schema?
Comment #3
leoperezpulido commentedYes. It is a local setup. Solr version 7.4.0, single core, default managed-schema. PHP version 7.2.10-0ubuntu0.18.04.1. Working with Search API 8.x.1-10, and Search API Pages 8.x.1.0-alpha12, along with Search API Autocomplete 8.x.1.0.
When query is introduced inside search box, the autocomplete shows the title of the node where the term is located, but when results are returned from the query nothing is rendered on the results page. No fragment with highlighted term with diacritical mark, only the title where the term is located.
Solr can't start up without a schema file and I have one single managed-schema file inside conf folder.
Comment #4
leoperezpulido commentedYes. It is a local setup. Solr version 7.4.0, single core, default schema.xml. PHP version 7.2.10-0ubuntu0.18.04.1. Working with Search API 8.x.1-10, and Search API Pages 8.x.1.0-alpha12, along with Search API Autocomplete 8.x.1.0.
When query is introduced inside search box, the autocomplete shows the title of the node where the term is located. But when results are returned, only the title of the node where the term is located is rendered on the results page, no fragment with highlighted term with diacritical mark.
Solr can't start up without a schema file and I have one single schema.xml file inside conf folder.
Comment #5
mkalkbrennerWhat do you mean with "default schema"? search_api_solr requires a drupal schema.
search_api_solr 8.x-1.x doesn't support Solr 7.x. You need to use search_api_solr 2.x and follow the instructions in README.md.
I can't recommend search_api_pages. It's not up to date. You should use Views to display your search results.
Comment #6
leoperezpulido commentedBy default schema I mean the schema file that comes when you download config.zip file from Search API > Server.
Let me upgrade to search_api_solr 8.x-2.2 and use Views to see if that solves the issue.
Comment #7
leoperezpulido commentedBrand new installation of Drupal 8.6.1 with installed search_api_solr 2.x. Try to render search results with the ASCIIFoldingFilterFactory applied to every field in the schema file (just in case). Fields to display: title and excerpt.
- Tested with a custom search View, get title field displayed but no fragment with keyword highlighted.
- Tested with Solr Search Defaults, get title field displayed but no fragment with keyword highlighted.
In every case the behavior is the same: to show the title of the node where the term is located in search results but not the fragment with the keyword highlighted. So that if, for example, I have only two documents indexed with the same content but one of them have diacritical marks, a query for a term on this documents will display the title fields of both documents but only one of them, the one without the diacritical marks, will be displayed as highlighted fragment.
Comment #8
mkalkbrennerOK, let me recap:
You have a working setup and you see highlighted search results if they only contain ASCII characters?
Is that correct?
So what's your expected behavior? Can you describe an example, what are your search keys, what do you expect to find and what should be highlighted?
Are you targeting a specific language and did you try the multilingual Solr backend?
Comment #9
leoperezpulido commentedI have two documents with two fields each: title and body. Content for the first is: Drupal is the leading open-source CMS. Content for the second is: Drûpal is the leading open-source CMS. Notice the diacritic in the second document. If you enter he query term: leading, everything works as expected [1]. Both documents return with the token highlighted.
Now I want to search for the term: drupal. Assuming that I have applied the ASCII filter, both documents would have to return with the tokens highlighted (as is the default behavior in Solr) but instead I get only one and a half because the document with the diacritic doesn't return the excerpt [2], only the title. To search for a token with a diacritic I need to type in the term with the accent, in this case: drûpal [3]. Please notice that also in this image I get both documents returned but this time the one without diacritics doesn't return the excerpt. That is not the expected behavior. Search best practices recommend to free users to enter query terms with diacritics and that is what the ASCII filter is for.
Comment #10
mkalkbrennerSeems like the patch in #3001030: The excerpt should leverage the backend highlighter with stemmer & accents might solve your issue.
Comment #11
leoperezpulido commentedThank you anyway.
Comment #12
mkalkbrennerDoes the patch solve your issue?
Comment #13
leoperezpulido commentedNo. Same behavior as before.
Comment #14
mkalkbrennerMaybe we should move the discussion to https://drupalchat.me/channel/search
That would be easier.
Comment #15
leoperezpulido commentedWrite to you there, then.
Comment #16
leoperezpulido commentedNow, the patch did solved the issue. The whole process boils down to:
Comment #17
mkalkbrennerThanks for the feedback. It would be great if you confirm that the patch is working at #3001030: The excerpt should leverage the backend highlighter with stemmer & accents, too!
Comment #18
mkalkbrennerComment #20
mkalkbrennerComment #21
mkalkbrennerComment #23
ncg777 commentedIt would be really nice to include a fix for this issue in the next release for 8.x-3.x.