Domanda

I have a content search web part in a catalog item page which I want to return the next List Item(s) in a specific category.

I am using term driven navigation with the following URL format:

http://[site url]/Term Root/Term/[owstaxIdCategory]/[ListItemID]/[Title]

The search query text of my web part is set to:

(contentclass:sts_listitem OR IsDocument:True) SPSiteUrl:[*site url*] ListId:d1f2fff3-ce68-46b6-85bf-431b20a3f156  owstaxIdCategory:{Term.IdWithChildren} ListItemID>{URLToken.2}

However, when I have test this query, it responds with:

We didn't understand your search terms. Make sure you're using the proper syntax.

If I change the last query condition to contains (ListItemID:{URLToken.2}), equals (ListItemID={URLToken.2}) or not equals (ListItemID<>{URLToken.2}) the query runs successfully.

When the condition is set to 'geater than', 'less than', 'greater than' or equals' or 'less than or equals', it fails with the 'We didn't understand your search terms.' error.

How can I get it to run the query based on the greater than condition?

È stato utile?

Soluzione

This was occuring because the ListItemId is a text managed property. It is not possible to use the '>' or '<' operators with text properties.

As a workaround, I created a new managed property (IntListItemId) of type Integer and mapped the crawled property ows_ListItemId to it. This allowed me to query it with the greater than property.

Resulting query text:

(contentclass:sts_listitem OR IsDocument:True) SPSiteUrl:[*site url*] ListId:d1f2fff3-ce68-46b6-85bf-431b20a3f156  owstaxIdCategory:{Term.IdWithChildren} IntListItemID>{URLToken.2}

A list of operators that can be used with the various property types can be found here: http://msdn.microsoft.com/en-us/library/office/ee558911%28v=office.15%29.aspx

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top