Friday 15 March 2013

python - Can Sphinx do a NOT AND filter with an IN clause? -


This question is a more complex extension.

In this example, though, suppose that I index with the following integer characteristics:

  class type  

In a category id and a assume that I have a list of category id:

  category_list = [1, 3,5, 7 9]  

and type A list of IDs:

  type_list = [1,2]   

I want to filter all the documents that are NOT (IN category_list and IN type_list)

once I'm using python sphinxapi Kpi .

Can this be done?

very similar, just IN () function

  .setSelect ("*, IN (category, 1,3,5,7,9) + IN (type, 1,2) AS myfilter") .setFilter ("myfilter", [2], true)  

Not sure the best dragon syntax for converting a list into a string, but it should not be difficult


No comments:

Post a Comment