-1

I am using SharePoint Search API and referring link SharePoint Search REST API overview. I want to use property operators. Please refer 'Property operators that are supported in property restrictions' section in link Keyword Query Language (KQL) syntax reference

I am forming query as http://server/_api/search/query?querytext='AmountCurrency > 10.50'&selectproperties='Title,Author'

Similarly http://server/_api/search/query?querytext='AmountNumber < 20.50'&selectproperties='Title,Author'

In above queries AmountCurrency and AmountNumber are managed properties for Currency column and Number column respectively. But search api not returing any row. For me : and = operators are working fine. How to use greater than and less than operators in search API?

Shailesh Jaiswal
  • 3,606
  • 13
  • 73
  • 124

2 Answers2

0

Make sure the field name you are using is defined in the Managed Properties in the Search Schema.

Or you can build the query using SharePoint Search Query Tool.

LZ_MSFT
  • 4,079
  • 1
  • 8
  • 9
0

Got it. It is due to the managed property type. Following are the available types when we create managed properties.

  • Text
  • Integer
  • Decimal
  • Date and Time
  • Yes/No
  • Double precision float
  • Binary

When managed property gets created automatically for site columns, the default type is Text. While creating managed property manually only Search Service Application administrator can choose any type. All other users can choose either Text or Yes/No.

I am not SSA Administrator. So I have used default unused managed properties. Please refer https://technet.microsoft.com/en-us/library/jj219667.aspx#Anchor_8. Used RefinableDecimal00 and RefinableDecimal01 and mapped appropriate crawled property to them. Now everything is working fine

Shailesh Jaiswal
  • 3,606
  • 13
  • 73
  • 124