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

Does suggest query support LANG search #9

Open
sincerefly opened this issue May 29, 2019 · 9 comments
Open

Does suggest query support LANG search #9

sincerefly opened this issue May 29, 2019 · 9 comments
Labels
bug Something isn't working

Comments

@sincerefly
Copy link

When push or query data, I use { LANG: "cmn" }, It's Mandarin Chinese, maybe the same as Simple Chinese

It's works well, testing data:

sonicChannelIngest.push("testing", "area_code", "230102", "黑龙江省哈尔滨市道里区", { LANG: "cmn" })
sonicChannelIngest.push("testing", "area_code", "230103", "黑龙江省哈尔滨市南岗区", { LANG: "cmn" })
sonicChannelIngest.push("testing", "area_code", "230104", "黑龙江省哈尔滨市道外区", { LANG: "cmn" })

# query
sonicChannelSearch.query("testing", "area_code",  "黑龙江省", { LANG: "cmn" })

# result
["230102", "230103", "230104"]

when use suggest:

sonicChannelSearch.suggest("testing", "area_code",  "黑龙江省")

got the error:

Error: { code: 'unexpected_error', message: 'query_error' }

so, does suggest support LANG params query, thanks

@valeriansaliou
Copy link
Owner

Suggest should work yes. What do you have in Sonic debug logs?

@sincerefly
Copy link
Author

@valeriansaliou

I use the v1.2.0 sonic deployed with docker images

the log when suggest "黑龙江省":

(DEBUG) - got channel message: SUGGEST testing area_code "黑龙江省"
(DEBUG) - will dispatch search command: SUGGEST
(DEBUG) - parsed text parts (still needs post-processing): "黑龙江省"
(DEBUG) - parsed text parts (post-processed): 黑龙江省
(DEBUG) - dispatching search suggest #c9vmnBCo on collection: testing and bucket: area_code
(DEBUG) - will suggest for #c9vmnBCo with text: 黑龙江省, limit: 5
(DEBUG) - not detecting locale from lexer text: 黑龙江省
(DEBUG) - fst store acquired from pool for collection: testing (pool key: <c89d0f8>/<1c01776c>)
(DEBUG) - lexer yielded word: 黑
(DEBUG) - lexer yielded word: 龙
(DEBUG) - wrote response with values: ERR (query_error)
(INFO) - took 0ms/308us/308505ns to process channel message

@valeriansaliou valeriansaliou added the bug Something isn't working label May 30, 2019
@valeriansaliou
Copy link
Owner

Thanks. Filing a bug. Will process it when I have time.

@18601673727
Copy link

I'm having same issue on valeriansaliou/sonic:v1.2.3

{ code: 'unexpected_error', message: 'query_error' }

@valeriansaliou
Copy link
Owner

@18601673727 are you sending Chinese characters in the command? Is that UTF-8 or UTF-8 extended or UTF-16?

@18601673727
Copy link

@valeriansaliou I'm sending Chinese characters via node-sonic-channel just like @sincerefly did, but one small difference is for single character like is OK, if I pass more than 1 like 黑龙 it gives that error, and I believe all of these characters are in UTF-8, no fancy staff say emojis. 😂

@jukbot
Copy link

jukbot commented Dec 25, 2019

got the same issue 'query_error' when parsing Thai language in suggest method.

@valeriansaliou
Copy link
Owner

Hello! SUGGEST does not support the LANG attr, as suggestions are langage unaware by design.

@zanpen2000
Copy link

got same issue on 1.2.6

(DEBUG) - got channel message: SUGGEST origin title "鲁迅" LIMIT(10)
(DEBUG) - will dispatch search command: SUGGEST
(DEBUG) - parsed text parts (still needs post-processing): "鲁迅"
(DEBUG) - parsed text parts (post-processed): 鲁迅
(DEBUG) - dispatching search suggest #CVaH6tE2 on collection: origin and bucket: title
(DEBUG) - parsed meta part as: LIMIT = 10
(DEBUG) - handle suggest meta: LIMIT = 10
(DEBUG) - will suggest for #CVaH6tE2 with text: 鲁迅, limit: 10
(DEBUG) - not detecting locale from lexer text: 鲁迅
(DEBUG) - fst store acquired from pool for collection: origin (pool key: <8b732c7e>/<7932423e>)
(DEBUG) - lexer yielded word: 鲁
(DEBUG) - lexer yielded word: 迅
(DEBUG) - wrote response with values: ERR (query_error)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants