Do site column custom choice fields work in query rules?

%3CLINGO-SUB%20id%3D%22lingo-sub-697259%22%20slang%3D%22en-US%22%3EDo%20site%20column%20custom%20choice%20fields%20work%20in%20query%20rules%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-697259%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20trying%20to%20sort%20search%20results%20by%20the%20following%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20search%20term%20is%20in%20the%20file's%20Title%2C%20move%20to%20top.%3C%2FP%3E%3CP%3EIf%20search%20term%20is%20in%20PlaybookCategoryOWSCHCM%20(Custom%20choice%20field.%20Also%20a%20site%20column.%26nbsp%3B%20I%20have%20it%20mapped%20to%20a%20crawled%20property%2C%20and%20I've%20made%20it%20queryable%2Fsearchable%20and%20checked%20'Allow%20multiple%20values').%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAll%20other%20results%20should%20be%20below%20those.%20The%20query%20rule%20is%20set%20to%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E((*%7BsearchTerms%7D*%20ContentTypeId%26lt%3B%26gt%3Bpng%20ContentTypeId%26lt%3B%26gt%3Bjpg%20ContentTypeId%26lt%3B%26gt%3Bgif%20ContentTypeId%26lt%3B%26gt%3Bpdf%20Path%3A%3CA%20href%3D%22https%3A%2F%2Fpcec.sharepoint.com%2Fsites%2FPlaybookV2Test%2FSitePages%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fpcec.sharepoint.com%2Fsites%2FPlaybookV2Test%2FSitePages%2F%3C%2FA%3E%3C%2FP%3E%3CP%3E-ContentClass%3Durn%3Acontent-class%3ASPSPeople%3C%2FP%3E%3CP%3EXRANK(cb%3D1.00%20stdb%3D1.00)%20Title%3A%20%7BsearchTerms%7D)%3C%2FP%3E%3CP%3EXRANK(cb%3D0.90%20stdb%3D0.90)%20PlaybookCategoryOWSCHCM%3A%20%7BsearchTerms%7D)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20doesn't%20seem%20to%20be%20working%20though.%20The%20Title%20matches%20are%20on%20top%2C%20which%20is%20good%2C%20but%20results%20with%20the%20search%20term%20in%20only%20the%20document%20body%20are%20being%20returned%20on%20top%20of%20results%20that%20have%20the%20term%20in%20the%20custom%20field.%26nbsp%3B%20I'm%20sure%20I'm%20doing%20something%20wrong%20or%20misunderstanding%20something%2C%20anyone%20have%20any%20idea%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-697259%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-750206%22%20slang%3D%22en-US%22%3ERe%3A%20Do%20site%20column%20custom%20choice%20fields%20work%20in%20query%20rules%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-750206%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F130969%22%20target%3D%22_blank%22%3E%40Perry%20Armiras%3C%2FA%3E%26nbsp%3BHave%20You%20created%2Fsaved%20the%20items%20after%20you%26nbsp%3B%3CSPAN%3Emapped%20the%20column%20to%20a%20crawled%20property%3F%20My%20experience%20is%20that%20if%20You%20map%20to%20a%20Crawled%20Property%20after%20the%20items%20are%20created%20they%20wont%20be%20indexed%2Fcrawled.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ERegards%2C%20Magnus%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

I'm trying to sort search results by the following:

 

If search term is in the file's Title, move to top.

If search term is in PlaybookCategoryOWSCHCM (Custom choice field. Also a site column.  I have it mapped to a crawled property, and I've made it queryable/searchable and checked 'Allow multiple values').

 

All other results should be below those. The query rule is set to:

 

((*{searchTerms}* ContentTypeId<>png ContentTypeId<>jpg ContentTypeId<>gif ContentTypeId<>pdf Path:https://pcec.sharepoint.com/sites/PlaybookV2Test/SitePages/

-ContentClass=urn:content-class:SPSPeople

XRANK(cb=1.00 stdb=1.00) Title: {searchTerms})

XRANK(cb=0.90 stdb=0.90) PlaybookCategoryOWSCHCM: {searchTerms})

 

This doesn't seem to be working though. The Title matches are on top, which is good, but results with the search term in only the document body are being returned on top of results that have the term in the custom field.  I'm sure I'm doing something wrong or misunderstanding something, anyone have any idea?

 

Thanks.

1 Reply
Highlighted

@Perry Armiras Have You created/saved the items after you mapped the column to a crawled property? My experience is that if You map to a Crawled Property after the items are created they wont be indexed/crawled.

 

Regards, Magnus