Search returns no results for specific key word
Hi,
This is the site.
https://www.fllcasts.com
It has materials which has title and description. The title and descriptions are indexed. Sometimes when I search for specific words from the titles it does not return results.
Example when working - https://www.fllcasts.com/search?utf8=%E2%9C%93&search=box
Example when not working - https://www.fllcasts.com/search?utf8=%E2%9C%93&search=camel
I would expect for the second case to see https://www.fllcasts.com/materials/416-camel-build-from-lego-ev3-mindstorms
It has 'Camel' in the title. Even if I search for the whole "Camel built from LEGO EV3 Mindstorms"
This means that some results are returned and others are not. And this is on the model level. So I've also debugged it and the call
def search query, page, per_page, classes = []
query = Riddle::Query.escape(query)
ThinkingSphinx.search(query,
classes: classes,
sql:{include: [:translations, :content_pictures]},
:without => @without,
:field_weights => CAST_CONFIG["episode_search"]["field_weights"],
:page=>page,
:per_page=>per_page)
end
does not return results for a search of "camel".
What else should I check. Where could this problem be coming from ?
Best Regards,
Kiril
Keyboard shortcuts
Generic
| ? | Show this help |
|---|---|
| ESC | Blurs the current field |
Comment Form
| r | Focus the comment reply box |
|---|---|
| ^ + ↩ | Submit the comment |
You can use Command ⌘ instead of Control ^ on Mac
Support Staff 1 Posted by Pat Allan on 25 Sep, 2018 10:58 AM
Hmm, I'm not spotting anything obviously wrong - it certainly sounds like the behaviour you're hoping for should work!
In that search call, what are the values of
classes,@without, andCAST_CONFIG["episode_search"]["field_weights"]?2 Posted by Kiril Mitov on 25 Sep, 2018 11:13 AM
The values are
classes = [Episode,Course,Material, Program], these are active records
@without - these are the ids of the not published object. An yes, Camel is
a published object. There is a field in the records called published_at
that I compare with current date and the unpublished and not shown
CAST_CONFIG["episode_search"]["field_weights"] is:
episode_search:
field_weights:
position: 50
name: 20
categories_names: 20
description: 15
long_description: 15
tag_names: 15
subtitles_html_content: 5
materials: 5
Best Regards,
Kiril
Support Staff 3 Posted by Pat Allan on 25 Sep, 2018 02:32 PM
The record's definitely there in Sphinx. I'm not yet sure why it's not appearing though… I would recommend you debug by starting with a basic search in your Rails console and then add in each of the options one by one to see how that influences results. For example:
4 Posted by Kiril Mitov on 01 Oct, 2018 06:21 AM
I did this. Nothing. It returns an empty result.
What else could I do?
Best Regards,
Kiril
Support Staff 5 Posted by Pat Allan on 01 Oct, 2018 09:15 PM
Does the simplest version of that (
Material.search "Camel") not work for you? I'm seeing the record in Sphinx, so I'm rather surprised if it doesn't get returned!I am presuming it's the app named
fllcasts- is this correct?