Nov 26 2019 11:36 AM
Nov 26 2019 12:27 PM
@Mackdewack take a look at the articles by @Mikael Svenson on his blog https://www.techmikael.com/2019/ there are many tips and tricks which may provide you the answer.
Nov 27 2019 01:25 AM
@Mackdewack first off you might end up with loose OR's in that statement when searchboxquery is empty. What you are looking for is adding () around the variable as I blogged about at https://www.techmikael.com/2019/08/search-nugget-grouping-property.html
Also, adding a *, will only wildcard enable the last term you input. An remember that adding * to a term, will remove it from getting rank points. Only individual terms are ranked, so relevance might drop when using wildcards.
Nov 27 2019 09:07 AM
Nov 27 2019 12:14 PM
Nov 28 2019 07:14 AM - edited Nov 28 2019 07:49 AM
@Mikael Svenson i'm almost there, i hope
This is my input query:
ContentType:xxx (Title:{searchboxquery}) OR (RefinableString1:{searchboxquery})
With the query i can search on titles and on the refinablestring1. When i start with the refinablestring after my results i can add extra words for the the title.
ContentType:xxx (Title:Microsoft 777) OR (RefinableString31:Microsoft 777) -ContentClass=urn:content-class:SPSPeople
Refinablestring = Microsoft
Title 777
When i use Microsoft 777 i see my result but when i use 777 Microsoft i got no results, doenst make any sense to me. Is there an explanation for?
Nov 28 2019 07:37 AM
Nov 28 2019 07:48 AM - edited Nov 28 2019 07:50 AM
Uhhh if i try it with the (), i can't combine the words together. Without the () i can combine it but i have to start with the string and then the title.
ContentType:xxx (Title:Microsoft 777) OR RefinableString31:Microsoft 777 -ContentClass=urn:content-class:SPSPeople
Nov 28 2019 10:34 AM
Nov 29 2019 01:20 AM
@Mikael Svenson Thanks for your time, here is a little more context. I have a site collection with around 10K documentsets. Every documentset have serval tags, these are text/choice/lookup column.
With the query i would like that we can search for the refinablestring. For example i had a lookup column with serval suppliers like Google, Microsoft, etc. There is also an product choice column so i would like that we can search for Microsoft hardware.
I doubt if this is possible with OOTB search features. What is your experience? Maybe i have to look to an SPFX webpart?
Nov 29 2019 02:05 AM
@Mackdewack remember that data isn columns are searchable by default, without using property queries. You can do OR queries as well if you want.
ContentType:xxx Title:ANY({searchboxquery}) OR RefinableString1:ANY({searchboxquery})
If you searched for "test microsoft" you will get matches where title or refineablestring1 has one of these terms.
I have no idea what your end users will be querying, so hard to figure out the best solution.
Nov 29 2019 02:46 AM
Are you sure, you can use ANY after the : ? If i look to my output query i got no results:
ContentType:xxx Title:ANY(microsoft) OR RefinableString1:ANY(microsoft) -ContentClass=urn:content-class:SPSPeople
About the end users. They need to search inside the side collection. The documents have serveral metadata tags so they would like to search for the metadata tags. The problems is, i can't now only search for the words in the title and one word from the metadata.
I would love to use 2 of 3 words from the different metadata columsn so that i will find my results and here is the problem. I don't get my query right... At this moment, this is my best query now, i can use serveral words for the title + one word from a metadata column. When i use two words from two differents words i dont get any results.
ContentType:xxx (Title:{searchboxquery}) OR (RefinableString1:{searchboxquery}) OR (RefinableString2:{searchboxquery}) OR (RefinableString3:{searchboxquery})
I will dig in your site and will try it!
Nov 29 2019 03:32 AM