I am using Fulltext Search Exposed Filter in Search API Views, and when the results are printed there is an extra comma is displaying in front of the titles, e.g.:
, First Title
, Second Title
When I remove the filter, then titles are shown fine as expected. This started happening after the recent module update.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 2780799-11--fix_views_highlighting.patch | 584 bytes | drunken monkey |
Comments
Comment #2
drunken monkeyThat's curious. Are you using the Solr backend, or the "Highlighting" processor (or both)?
Does this always occur when the filter (the search field) is present, or only when you input something there?
What are the view's style settings? Unordered list of Fields?
Do you have some additional modules (custom or contrib) installed that could influence this behavior (i.e., modules integrating with Views or Search API – particularly less popular ones). I'm pretty sure that this problem doesn't exist in most installations, so there's got to be something specific about your setup.
From which version did you update, 1.18?
If you are a bit tech-savvy, the optimum would be if you could do a
git bissectto see which change in particular introduced the problem.PS: It seems you (like many others – it's really easy to misinterpret) are confused by the "Issue tags" field. As the guidelines state, they aren't meant for free text tags related to the issue, but only for specific categorization purposes, usually by module maintainers.
So, if you aren't sure your current usage is correct, please just leave the field empty.
Comment #3
broeker commentedFor what is is worth after making some various config changes to a previously working search API view, this started happening us also. An comma appears before every result title, and if you view source you find that there is an empty href in there pointing to the node:
<a href="node/1"></a>, <a href="node/1>My node</a>I was able to fix by excluding the TITLE field from the excerpt settings within the Highlight processor...
Comment #4
drunken monkeyAre you maybe using a Solr backend and have incompatible processors enabled on your Search API index? (Most of them shouldn't be used along with Solr.)
Comment #5
dalemoore commentedI'm having this same issue. I'm using the search database module, not Solr or anything else. I do have the highlighting turned on.
It only occurs when using the fields that have the index name in the front, like "[Index Name]: [field] (indexed)", not the ones that start with Search:, like "Search: [Index Name] results"
Excluding the title / file name in the highlighting processor does seem to fix it, but I do want the word highlighted in there...
Here's my view's settings:
Format: HTML List
Show: Fields
Fields
Node Index: Title (indexed)
File Index: File name (indexed)
Search: Excerpt
Filter Criteria
Search: Fulltext search (exposed)
Node Index: Content type (indexed) (exposed)
File Index: File type (indexed) (exposed)
Sort Criteria
Search: Relevance (desc)
Here's the Export code for the view (I'm using the Page display):
Comment #6
drunken monkeyPlease use attachments for adding Views exports, this is otherwise a pain to scroll over.
Did this work for you in a previous version, too?
Also, I see you're using the
search_api_multimodule for creating the view, which is another matter entirely. Can you re-create the problem with a normal view, based on a single index's base table, too? Otherwise, we should either move this issue or create a new one in thesearch_api_multiproject.Comment #7
dalemoore commentedSorry for the delayed response, I ended up just excluding the title and moving on, but I've just ran into this issue again and went looking to how I solved it and found this post again.
It does seem to be only related to using the multi-index approach, I created a view that uses just the single index and it doesn't occur.
Comment #8
drunken monkeyHm, OK, that's at least something.
Still, it might be the highlighting processor after all, just triggered by the multi-index view.
Can you see if the attached patch resolves the problem for you? (Not an actual solution, but just for finding out where the bug is.)
Comment #9
drunken monkeyOops, here's the patch.
Comment #10
dalemoore commentedIt doesn't seem to have affected anything. I'm on Search API 7.x-1.22, Multi-index searches 7.x-1.4, Database search 7.x-1.6, Search views 7.x-1.22 if any of that matters.
I've attached a screenshot of what's happening.
Comment #11
drunken monkeyAh, now I think I've got it! Thanks for the continued feedback!
Patch attached, please test!
Comment #13
drunken monkeyAh, just had the wrong project set.
Comment #15
drunken monkeyCommitted.
A review would have been nice, but still, thanks again for your help!
Comment #17
dalemoore commentedSorry for delayed response again. ಠ_ಠ I was wondering why I never get notifications on topics I follow, I had somehow turned off notifications by email in the "Issue notifications" tab of my settings... Anyhow, patch applied and working. Thanks!