How can search in whole foums/ Not getting actual result

can any buddy let me know that what is the difference between below codes

by below code i am getting 0 result

#set ($searchQuery = "%{}")
#set($query = "s section:1546" )
$searchQuery.Add("FieldFilters", "0,category,blog")
$searchQuery.Add("Query", $query)
$searchQuery.Add("Collapse", true)
#set($results = $core_v2_searchResult.List($searchQuery))
count $results.TotalCount

But in below code getting 100 record because it search sitewide

#set ($searchQuery = "%{}")
#set($query = "s" )
$searchQuery.Add("FieldFilters", "0,category,blog")
$searchQuery.Add("Query", $query)
$searchQuery.Add("Collapse", true)
#set($results = $core_v2_searchResult.List($searchQuery))
count $results.TotalCount

Then how can filter sitewide search result by blog/forum,section,tag etc

Parents Reply
  • You cannot use query syntax (AND, &&, etc) to join multiple filters when using the .Filters property. Is must in the format mentioned where || is the separator:

    field1::value1||field2::value2||field3::value3

    Filters in this property are always a MUST (required) so effectively AND(ed) together; i.e. all conditions must match. You can apply SHOULDs/OR to the field values with a single filter (ex. type::(blog forum))

    So for your scenario you need to use the format in my previous reply which in this case would be "type::blog||section::1546"

    As for your last example, my guess is that it didnt apply any filter.

Children
No Data