No.of occurrence in a file using windows search service

218 Views Asked by At

I am using windows search service to get the data from a particular folder and using the below query

SELECT System.ItemName,System.ItemType,RANK,System.ItemPathDisplay FROM SystemIndex WHERE directory = 'file:C:/Test/' and CONTAINS ('Swiggy')

Here I want to get the no. occurrence in the select clause based on the keyword which I used in Contains.

Meaning I need to find out How many places the key word (Swiggy) is present in my file

I have noticed the RANK column which is giving based on some other logic. Can any one help me to get the Count.

1

There are 1 best solutions below

0
DennisP On

You can reference System.Search.HitCount if you use the CONTAINS type of SELECT query. Otherwise, the System.Search.Rank will return a ranking relevance from 0 to 1000 (where higher is better relevance).