sphinx search: querying using implicit AND not returning the result -


using sphinx search v2.2.9, query returns particular record:

((@(author) fstaed) | (@(authsurname) fstaed) | (@(authori) fstaed) ) 

this query returns same record:

(@(issued) 2007) 

but query (which believe implied "and" combination of above 2 queries not return record:

(@(issued) 2007) ((@(author) fstaed) | (@(authsurname) fstaed) | (@(authori) fstaed) )  

why?

update 1:

i can reproduce problem using mysql command line, below shows running each of above 3 tests. note id: 187 in both individual result sets not combined result set.

$ mysql -h0 -p9306 welcome mysql monitor.  commands end ; or \g. mysql connection id 1 server version: 2.2.9-id64-release (rel22-r5006)  copyright (c) 2000, 2015, oracle and/or affiliates. rights reserved.  oracle registered trademark of oracle corporation and/or affiliates. other names may trademarks of respective owners.  type 'help;' or '\h' help. type '\c' clear current input statement.  mysql> select id, weight() `work` match('(@(issued) 2007)') , `sphinx_deleted` = 0 limit 0, 1000 option ranker=proximity_bm25 -> ; +------+----------+ | id   | weight() | +------+----------+ |  187 |     1604 | |  200 |     1604 | |  215 |     1604 | ..i cutoff these results irrelevant. +------+----------+ 40 rows in set, 1 warning (0.01 sec)  mysql> select id, weight() `work` match('((@(author) fstaed)  | (@(authsurname) fstaed)  | (@(authori) fstaed) )') , `sphinx_deleted` = 0 limit 0, 1000 option ranker=proximity_bm25 -> ; +------+----------+ | id   | weight() | +------+----------+ |  187 |     1560 | |  383 |     1560 | +------+----------+ 2 rows in set, 1 warning (0.01 sec)  mysql> select id, weight() `work` match('(@(issued) 2007) ((@(author) fstaed)  | (@(authsurname) fstaed)  | (@(authori) fstaed) )') , `sphinx_deleted` = 0 limit 0, 1000 option ranker=proximity_bm25 -> ; empty set, 1 warning (0.01 sec)  mysql>  

update 2:

i should mention "work" index distributed index between number of indexes includes "iresrevi1_core" , "iresrevi2_core". "issued" field null in iresrevi2_core index (not null in iresrevi1_core index) , authori field being searched null in opposite index iresrevi1_core (not null in iresrevi2_core index).

i think might have this? can confirm if query 2 indexes directly iresrevi1_core index return issued search data iresrevi2_core index not return issued search data. vice versa, iresrevi2_core return author search data iresrevi1_core not.

i have multiple indexes distributed such can index fields want search using "non infix" methods (forcing on "infix" fields blank in index) , fields want search using "infix" methods sitting on other index "non-infix" fields blanked out. 2 sources/indexes this:

source srcresrevi1 : srcresrev {     sql_query       = \     select sql_no_cache `work`.`id` `id`, '' authori \      work \      (`work`.`id` between $start , $end) \      , `work`.`id` <= (select max_id sphinx_deltas id = 1)  sql_joined_field = authsurname ranged-query; \     select sql_no_cache wa.work_id id, s.surname \     `work_authors` wa, \          `author_surnames` s \     wa.author_surname_id = s.id \     , wa.work_id >= $start , wa.work_id <= $end \     , `wa`.`work_id` <= (select max_id sphinx_deltas id = 1) \     order wa.work_id asc; \     select min(work_id), max(work_id) `work_authors` \     work_id <= (select max_id sphinx_deltas id = 1)  sql_joined_field = author ranged-query; \     select sql_no_cache wa.work_id id, concat(f.given,' ',s.surname) \     `work_authors` wa, `author_surnames` s, `author_fnames` f \     wa.author_surname_id = s.id \     , wa.author_fname_id = f.id \     , wa.work_id >= $start , wa.work_id <= $end \     , `wa`.`work_id` <= (select max_id sphinx_deltas id = 1) \     order wa.work_id asc; \     select min(work_id), max(work_id) `work_authors` \     work_id <= (select max_id sphinx_deltas id = 1)  sql_joined_field = issued ranged-query; \     select sql_no_cache work_id id, `year` \     issued \     work_id >= $start , work_id <= $end \     , work_id <= (select max_id sphinx_deltas id = 1) \     order work_id asc; \     select min(work_id), max(work_id) `issued` \     work_id <= (select max_id sphinx_deltas id = 1) }  source srcresrevi2 : srcresrev {     sql_query       = \     select sql_no_cache `work`.`id` `id`, '' authsurname, '' author, '' issued \             work \             (`work`.`id` between $start , $end) \             , `work`.`id` <= (select max_id sphinx_deltas id = 1)  sql_joined_field = authori ranged-query; \     select sql_no_cache wa.work_id, concat(f.given,' ',s.surname) \     `work_authors` wa, `author_surnames` s, `author_fnames` f \     wa.author_surname_id = s.id \     , wa.author_fname_id = f.id \     , work_id >= $start , work_id <= $end \     , work_id <= (select max_id sphinx_deltas id = 1) \     order wa.work_id asc; \     select min(work_id), max(work_id) `work_authors` \     work_id <= (select max_id sphinx_deltas id = 1) }  index iresrevi1_core { source          = srcresrevi1 path = /home/resrev/pubrevit/db/sphinx/development/iresrevi1 docinfo         = extern dict            = keywords mlock           = 0 morphology      = stem_en charset_table = 0..9, a..z->a..z, _, a..z, \         u+410..u+42f->u+430..u+44f, u+430..u+44f min_word_len        = 3 expand_keywords     = 0 ngram_len       = 1 ngram_chars     = u+3000..u+2fa1f html_strip      = 1 html_remove_elements    = style, script, head, doctype, !doctype inplace_enable      = 1 index_exact_words   = 0 index_sp        = 0 index_field_lengths = 1 }  index iresrevi2_core { source          = srcresrevi2 path = /home/resrev/pubrevit/db/sphinx/development/iresrevi2 docinfo         = extern dict            = keywords mlock           = 0 morphology      = stem_en charset_table = 0..9, a..z->a..z, _, a..z, \         u+410..u+42f->u+430..u+44f, u+430..u+44f min_word_len        = 3 min_infix_len       = 3 expand_keywords     = 1 ngram_len       = 1 ngram_chars     = u+3000..u+2fa1f html_strip      = 1 html_remove_elements    = style, script, head, doctype, !doctype inplace_enable      = 1 index_exact_words   = 0 index_sp        = 1 index_field_lengths = 1 } 

so yes, multiple distinct indexes problem. union not join.

as thread found, there more recent thread here too, mentions possibly using @@relaxed work around it. sill work distributed index.

http://sphinxsearch.com/forum/view.html?id=13581


Comments