Hi, 

I'm using the global search functionality for two models with the classes 
option: 

ThinkingSphinx
.search_for_ids(
classes: [Folder, Project],
conditions: { name: Riddle::Query.escape(search) },
order: 'w DESC',
select: '*, weight() AS w',
star: true
)

However, when I inspect the weight for each result by doing .pluck(
'sphinx_internal_class', 'name_sort', 'w'), it's not quite what I'm 
expecting because they seem to be constant for each classes - the search 
value was "test":

[["Folder", "tEST", 1630],
 ["Folder", "TEST!", 1630],
 ["Folder", "TEST!!", 1630],
 ["Folder", "testsssss", 1630],
 ["Folder", "testsdafdsfdsfs", 1630],
 ["Folder", "testshirley", 1630],
 ["Folder", "testa", 1630],
 ["Project", "Test Project", 1563],
 ["Project", "TEST", 1563],
 ["Project", "test", 1563],
 ["Project", "TEST!", 1563],
 ["Project", "TEST!", 1563],
 ["Project", "tracking test", 1563],
 ["Project", "TEST", 1563],
 ["Project", "test", 1563],
 ["Project", "test", 1563],
 ["Project", "Duplicate of TEST!", 1563],
 ["Project", "test", 1563],
 ["Project", "test2", 1563],
 ["Project", "test3333", 1563]] 

I also tested this with one class instead of two or even using the single 
model syntax: Folder.search_for_ids but the weight is the same as above. 
Was expecting the weight to differ depending on the name.

Thank you in advance!

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/thinking-sphinx/a1636dcd-c494-40b9-9de7-cf13cad22f2dn%40googlegroups.com.

Reply via email to