Russian search (cyrillic)
Please, help me!
How to configure the search for support of Russian words?
Any variants?
Perhaps your module can search as standard EE search module, bypassing table "..lexicon", right in channel_titles + channel_data?
Replies
Low 17 Dec 2015 12:38
Low Search should work just fine with non-latin languages like Greek or Russian. What are you finding does not work?
Denik 17 Dec 2015 13:31
I use next tags for my search:
Form:
{exp:low_search:form required="keywords"}
Search
{/exp:low_search:form}
Result page:
{exp:low_search:results
channel="catalog"
query="{segment_2}"
keywords:inflect="yes"
keywords:loose="both"
limit="30"
}
{title}
{/exp:low_search:results}
My entries in catalog channel - have russian and english words.
Global settings: http://prntscr.com/9f98s1 (License key is hidden)
If I create Collections and index it:
- in table exp_low_search_indexes - present only english words
- search by english keywords worked correctly
- search by russian keywords - not working
If I delete Collection:
- search by english keywords returns - not found
- search by russian keywords returned all catalogs (not filtered)
Low 17 Dec 2015 13:36
What version of LS and PHP are you using?
If you want to search by keywords, you need at least one collection. Are the fields that contain the Russian keywords weighted?
You can look up the query that LS generates by enabling the Template Debugger and Output Profiler, and looking up the query generated by the file lsf.keywords.php. Also, you can look through the Template Debugger and take note of the lines that mention Low Search. What does that tell you?
Denik 17 Dec 2015 14:17
PHP Version 5.3.29
Low search Version 4.4.1
My template source code: http://pastebin.com/jCTHBmTK
Only one query by lsf.keywords.php:
SELECT 'channel_id', 'channel_name', 'search_excerpt', IF(search_results_url='', channel_url, search_results_url) AS url
FROM ('exp_channels')
WHERE 'site_id' IN ('1')
AND 'channel_name' IN ('catalog')
#APP/third_party/low_search/filters/keywords/lsf.keywords.php L:494 Low_search_filter_keywords::_no_keywords()
Template log: http://prntscr.com/9f9udc
(As I see - error in encoding, buy DB encoding is correctly UTF8)
Search in admin CP - working :)
Low 17 Dec 2015 14:19
I'll need to take a look myself. Please send SuperAdmin and FTP login credentials to hi at gotolow dot com if you can.
Low 17 Dec 2015 15:32
Looks like the server didn't quite support the way LS cleans the content for its index. I've made a small change on your test site. Can you try again?
If you want to test locally, open up /low_search/libraries/Low_search_words.php and look up line 339, which reads:
Change that to:
Denik 17 Dec 2015 15:57
hmm ... I did don't know this construction yet (\P{L}+), I tried to set the correct locale.
Thank you very much, now the search has worked.
Follow-up: if the "manual" add entries to the channel (channel_titles + channel_data), what should be called to Low search index new data?
This is when importing an XML document.
Maybe you module have a API, like ->low_search->update_index($entry_id) ?
Low 17 Dec 2015 16:03
You can take a look at this: http://gotolow.com/addons/low-search/...
Otherwise, you could programmatically update the index, but that's not really supported. You can check out the Low_search_index.php library, if you want to try it yourself.
Denik 17 Dec 2015 16:28
ok, thank you once again for the quick help
best regards