[MTE-151] searchfn doesn't search the configured node Created: 22/Aug/23 Updated: 29/Nov/23 |
|
| Status: | Open |
| Project: | Magnolia Templating Essentials |
| Component/s: | None |
| Affects Version/s: | 2.0.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Richard Gange | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Template: |
|
||||||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||||||||||
| Epic Link: | Support | ||||||||||||||||
| Team: | |||||||||||||||||
| Description |
|
The query used in searchfn searches on the subnodes of the provided node. This skips the data the on the passed in path leading to a confusing developer experience. For example, the travel-demo search results component provides /travel in the ftl. Turning on the debug for SearchTemplatingFunctions we find: DEBUG info.magnolia.templating.functions.SearchTemplatingFunctions 22.08.2023 08:35:52 -- Executing query against workspace [website] with statement [SELECT rep:excerpt() from mgnl:page WHERE jcr:path like '/travel/%' AND contains(., 'Richard') ORDER BY jcr:score DESC] and limit 2147483647 and offset 0... DEBUG info.magnolia.templating.functions.SearchTemplatingFunctions 22.08.2023 08:35:52 -- Query execution took 2 ms DEBUG info.magnolia.templating.functions.SearchTemplatingFunctions 22.08.2023 08:35:52 -- Executing query against workspace [tours] with statement [SELECT rep:excerpt() from mgnl:content WHERE jcr:path like '/magnolia-travels/%' AND contains(., 'Richard') ORDER BY jcr:score DESC] and limit 2147483647 and offset 0... DEBUG info.magnolia.templating.functions.SearchTemplatingFunctions 22.08.2023 08:35:52 -- Query execution took 2 ms Now we can see the first query of the website workspace /travel/% which skips the node travel entirely. Reproduce
Expected Actual Notes SELECT rep:excerpt() from mgnl:page WHERE jcr:path like '/travel/%' AND contains(., 'Richard') ORDER BY jcr:score DESC SELECT rep:excerpt() from mgnl:page WHERE jcr:path like '/travel' AND contains(., 'Richard') ORDER BY jcr:score DESC |