Closed edarroudi closed 2 years ago
Hi @edarroudi , unfortunately, there is no query template option for the Microsoft Search API for now. We can't do much about that :/. For the features you want to add, please describe them in 'Ideas' section in the discussions tab https://github.com/microsoft-search/pnp-modern-search/discussions/categories/ideas.
Hi @edarroudi , unfortunately, there is no query template option for the Microsoft Search API for now. We can't do much about that :/. For the features you want to add, please describe them in 'Ideas' section in the discussions tab https://github.com/microsoft-search/pnp-modern-search/discussions/categories/ideas.
hey @FranckyC , Thank you for your reply. I actually don’t specifically need a querytemplate but just a way to enhance /modify the user query as shown in my screenshot. I modified the code and just pass it in the query string and that works fine. Would that be a bad feature? I don’t see an issue here.
@edarroudi I think that makes sense. Have the option to specify additional KQL in the web part which is appended to the user query.
Hey @wobba , thanks. As i already coded that (have to refactor it a bit), is it ok for me to create a pull request? I'm new to this kind of community driven coding so sorry for any stupid questions. Would you need some specific naming for the label? I used the label Query Template but maybe the naming will cause some misunderstanding. How about "KQL Query modifier"?
Also on another topic: I see that in /searchparts/.gitignore you have the package-lock.json added but not in /search-extensibility . Any reason for that? I usually keep package-lock.json in the respository as mostly everyone uses npm ci instead of npm i.
I will add now several feature requests and discussions to the discussion board as @FranckyC suggested.
Thank you all for your work!
We'll take a look at the PR
@wobba let me check the PR as well before merging, Thanks!
included in (develop) - December release
@FranckyC I see "queryTemplate" now working in the v1.0 endpoint for graph, so we could do a generic implementation targeting that field for both SP and Graph providers. It likely won't support all tokens, but that's ok as we replace many of them client side.
Is custom query template condition working in Microsoft search as data source
@Ami99049 reading the official documentation is the way to go :) https://learn.microsoft.com/en-us/graph/search-concept-query-template and we use this when crafting the query. That said, queryText + template is concatenated anyways for the actual query.
Is your feature request related to a problem? Please describe. I need to be able to add a prefilter to the Search Results webpart. This is possible for the SharePoint search with the "Query template" property but not for the Microsoft Search data source.
Describe the solution you'd like It would be nice to add the query template property for Microsoft Search data source as well. I did develop this myself and it works fine.
Describe alternatives you've considered Using filters wouldn't work, i thought of a custom searchbox component that sends the modified query to the search results webpart but that doesn't make any sense.
Additional context I have a task to modify & add some additional features to the modern search webparts. I consider some of the modifications as "too company specific" but some of the changes could be of use for the global community. How should i approach this, a) upload a list of possible features and you vote which ones can be implemented by me (maybe with some modifications) or b) just create pull requests and you have a look at those modifications?