Hi @Dawn. The set up you have looks correct.
And keyword search will check the module items âNameâ, âDescriptionâ and âSite Search Keywordsâ fields.
The only things I can suggest so far is to double check your âmoduleIdâ is correct in the form code and that your component tag on the search results page is configured correctly with the isSearchResult: "true" parameter and is referencing a valid list layout.
@Adam.Wilson@Dawn I think you guys have mixed up site search and module search. Dawnâs latest code sample (the component tag, the part starting with â</aside>â I donât get as the screenshot is not showing for me) is for site search, you need to put this on the results page. And the search form needs to have this code: action="[URL of you results page]" in the form tag. @Adam.Wilson you comment is referring to search within a specific module (hence the question about having the right module id and isSearchResult: "true" in the module tag. Unfortunately using the keyword field in the module search form is only working for keywords you put in the keyword field of item settings. I would have hoped it also searches in the name and description fields - but that doesnât seem to work. The form for module search can be generated in the component manager here:
Sorry I am really confused now - just to recap - I have created a custom module for videos on this page (https://scopal.treepl.co/videos)
I would like people to be able to search the content of this video module only (not a site wide search) and the results to be shown on a new page -
My coding is not great so any code hints are really gratefully received but would need to be the complete code .
This is the code I am using at the moment. (sorry I have had to show as a screen grab as it doesnt show when I paste into this form)
@Dawn The code on the results page yourâre using is for site search. If you want to do search in a module you get the right code in the component manager here:
(1) give you the code for the form; (2) is for the results. Itâs basically the component tag for the module with isSearchResult: "true" (as @Adam.Wilson mentioned) added to the parameters. It works right away if both are on he same page. With a separate results page you need to add action="[URL of your results page]" to the form tag of the search form (but I think you already did that).
Now here is the thing: The keyword field in the module search form doesnât seem to work for item names and descriptions (unfortunately). I just tried that as I also have a use case for this. Only works on the keywords property. For name and description you would have to use site search which then again is giving you results for the entire site. @Adam.Wilson Am I right with this?
@TimL I think something has changed with module search because the generated form code it gives now outputs the Site Search Keywords field, which yes, will only search that specific field. ie:
However, Iâm sure it used to output a special KeyWords field. But now it doesnât.
But this field still works for module search and looks at Name Description and Site Search Keyword fields together:
<input type="text" name="prop_KeyWords">
So, in your case @Dawn, you just need the correct module tag on your search results page as Tim mentions above. Which should be something like this: