SOLVED

Inconsistant results from web part KQL query

Copper Contributor

Hi. I am testing the use of KQL in webparts. The site collection has separate sites, libraries in each site and some documents in OneDrive for individual users. I am populating the file/document 'title' property with structured text. The title field contains indicators of document type and service area. This would appear something like "title=Policy: Property Services".

 

 

The test library contains 23 documents each with a populated title field.

I have two web part queries. The first returns any documents which do not have the correctly structured text in the title - (FileExtension:doc OR FileExtension:docx OR FileExtension:xls OR FileExtension:xlsx OR FileExtension:'ppt' OR FileExtension:'pptx' OR FileExtension:'pdf') (IsDocument:"True" OR contentclass:"STS_ListItem") AND -title:'policy': AND -title:'procedure': AND -title:guidance: AND -title:strategy: 

 

The second query returns results for any document where title = policy:'property' services - (FileExtension:doc OR FileExtension:docx OR FileExtension:xls OR FileExtension:xlsx OR FileExtension:'ppt' OR FileExtension:'pptx' OR FileExtension:'pdf') (IsDocument:"True" OR contentclass:"STS_ListItem") Title:=policy: property services 

NOTE: Please excuse the extra inverted commas above. This stupid interface wants to interpret colon p as a smiley face.

 

This works well for 22 of the 23 documents I'm searching for. The last one is a newly created document which is consistantly returned by query 1 even though it has "policy:" in the title field and never returned by query 2 even though the title is populated with "policy: property services".

 

I have tried re-index of the collection and of the library, I have also deleted the document from the library and reimported it. Once deleted the document disapears from search results after around 10 minutes. Once reimported it reappears in search results after around 10 minutes, but still wrong.

 

Any suggestions gratefully recieved.

 

Chris

6 Replies
best response confirmed by Chris Watkins (Copper Contributor)
Solution

Hi, can you use the SP2013 query tool and inspect what the Title value is for that one document? It could be the automatic extracted title which trips you up as the default mapping of crawled properties for the Title managed property is not a good one imo.

The Search Query Tool can be useful for troubleshooting problems like this, http://sp2013searchtool.codeplex.com/.

 

@Mikael Svenson may be able to help also

Thanks guys. I'll download it and give it a try

Could it be you want the fileleafref instead of the title? as title can also be a docproperty which is the first thing Search finds in your document

Here's my recommended list to the order of crawled properties for the Title managed property:

 

  • TermTitle
  • ows_BaseName
  • Office:2
  • Title

and move MetadataExtractorTitle to the very bottom.

 

Here's an article explaining it all and you can change the order to suit your needs: https://blogs.msdn.microsoft.com/spses/2013/10/30/show-more-relevant-titles-in-search-results-in-sha...

 

Remember to re-index after you change mapping order.


@Mikael Svenson wrote:

Here's my recommended list to the order of crawled properties for the Title managed property:

 

  • TermTitle
  • ows_BaseName
  • Office:2
  • Title

and move MetadataExtractorTitle to the very bottom.

 

Here's an article explaining it all and you can change the order to suit your needs: https://blogs.msdn.microsoft.com/spses/2013/10/30/show-more-relevant-titles-in-search-results-in-sha...

 

Remember to re-index after you change mapping order.


Thanks Mikael. That was exactly it. Problem now resolved.

 

Chris

1 best response

Accepted Solutions
best response confirmed by Chris Watkins (Copper Contributor)
Solution

Hi, can you use the SP2013 query tool and inspect what the Title value is for that one document? It could be the automatic extracted title which trips you up as the default mapping of crawled properties for the Title managed property is not a good one imo.

View solution in original post