Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Filter query for smart search View modes: 
User avatar
Member
Member
Peter - 7/22/2013 7:51:42 PM
   
Filter query for smart search
Hi,
We have setup a smart search to search through 2 document types and need to filter them according to dropdown list value.

In the dropdown we have a list of states.
In document 1 we have a field "AddressState" with a single value (for example "NSW").
In document 2 we have a field "AddressStates" which can have multiple states separted by space (for example "VIC NSW ACT").

I have setup the filter string to be something like this "+( AddressState:NSW )" which works fine for document 1. However we need also to bring a result for document 2 if the "AddressStates" has a value "NSW".

The query should be "where AddressState = 'NSW' OR AddressStates like '%NSW%'"

From the Lucene documentation we cannot user wildcart "*" at the begining.

Currently we are thinking about running the result without filtering and then use code behind to loop through the result and filter it there.

Any suggestions?

Thank you
Peter


User avatar
Member
Member
Peter - 7/22/2013 8:13:10 PM
   
RE:Filter query for smart search
If anyone is interested we have solved it like this.

We set the search field "AddressStates" tokenized and then set the filter
+(AddressStates:NSW OR AddressState:NSW)

Regards
Peter