Closed darashi closed 12 years ago
For example:
It returns blank page, but it should 7 results. The page internally sends a request to GCS server, as:
.../2011-02-01/search?q=console&start=0&size=20&facet=path&bq=path%3A'Addon%20patterns'
So, bq => groonga query translator possibly has a bug around such queries.
path 'Addon patterns'
is not a valid bq pattern. It should be (and 'path' 'Addon patterns')
if it means the default search fields should include path
and Addon patterns
words.
{ table: 'example_tvd8fbgghbv6ncikqe1jvhl7wa', filter: '((address @ "Tokyo" || email_address @ "Tokyo" || name @ "Tokyo")) && (products @ "milter" && products @ "manager")', limit: 5, offset: 0, output_columns: '_key, address, email_address, name, products' } GET /2011-02-01/search?q=Tokyo&bq=products:%27milter%20manager%27&size=5&start=0&return-fields=products,address%2Cemail_address%2Cname 200 10ms
Anyway, '(products @ "milter" && products @ "manager")' is not an expected result. It should be '(products == "milter manager")' if it is a literal field, isn't it?
@kou: How about path:'Addon patterns'
? %3A
should be recognized as :
.
@piroor: for literal fields, ==
should be reasonable
Ah, sorry. path:'Addon patterns'
is valid pattern. What the result of the pattern is translated?
Where is milter manager
came from?
GET /2011-02-01/search?q=Tokyo&facet=products&size=5&start=0&return-fields=products,address%2Cemail_address%2Cname 200 9ms
doesn't have it.
It was a wrong log. I've updated the comment.
q=Tokyo&bq=products:%27milter%20manager%27
becomes
((address @ "Tokyo" || email_address @ "Tokyo" || name @ "Tokyo")) && (products @ "milter" && products @ "manager")
Thanks. OK. I understand.
bq translator needs column information for it but it doesn't have the information.
Workaround: bq=products:'"milter manager"'
. It will be trasnalated to products @ "milter manager"
. It will work.
@darashi Could you confirm Amazon CloudSearch behavior? Can bq=products:'milter'
find milter manager
if products
column has only milter manager
value?
For the query bq=t:'scary'
, that is, /2011-02-01/search?bq=t:'scary'&return-fields=director%2Ct%2Ctitle%2Cyear%2Ctext_relevance
,
{"rank":"-text_relevance","match-expr":"(label t:'scary')","hits":{"found":0,"start":0,"hit":[]},"info":{"rid":"8b46e820abdf9c2b6422cf05f897b7f6c03c8c360d8dd2651c7bffedf0591314bab27aaec5e59494","time-ms":2,"cpu-time-ms":0}}
returned. 0 hit. t
is a literal field.
For the query, bq=t:'scary movie'
, that is,
/2011-02-01/search?bq=t:'scary%20movie'&return-fields=director%2Ct%2Ctitle%2Cyear%2Ctext_relevance
{"rank":"-text_relevance","match-expr":"(label t:'scary movie')","hits":{"found":1,"start":0,"hit":[{"id":"tt0175142","data":{"director":["Wayans, Keenen Ivory"],"t":["Scary Movie"],"text_relevance":["337"],"title":["Scary Movie"],"year":["2000"]}}]},"info":{"rid":"8b46e820abdf9c2b6422cf05f897b7f62052793f55a05effb73e3d80be4e5e9039e868dadb1e6120","time-ms":3,"cpu-time-ms":0}}
returned. 1 record matched.
Is this enough for the confirmation?
Done. Now, operators are changed by field types.
@darashi Thanks! It's enough. It's OK that we use ==
rather than @
. So @piroor's change is OK.
Not known in detail yet, but some unexpected behavior of bq params were seen. Investigate and Fix.