Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
improve search results
One of the problems with the search results is the way it omits spaces.
The name Chang for example v the word change are both returned even if a space is added after the name.
This is something that has already been solved in smd_where_used
where Chang
only returns the name and Chang
returns occurrences of both the name and the word.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: improve search results
Yes but some people might actually want that wildcard search behaviour. My plugin uses binary search if I remember correctly. Having an option in the search tag to switch on binary might be handy if we don’t have that already.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: improve search results
You can try m="natural"
attribute. Somewhat related?
See the difference between www.neme.org/?m=all&q=peint and www.neme.org/?m=natural&q=peint
Offline
Re: improve search results
etc wrote #333474:
You can try
m="natural"
attribute. Somewhat related?
I’m so curious (because the results are the kind I’m looking for): where is this m="all"
attribute for (in which mysterious tag)? 🤔
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Offline
Re: improve search results
I tried to set the match
attribute on natural
instead of any
for the <txp:search_input />
tag.
The request URL didn’t inject any m
parameter (Textpattern 4.8.8.)…
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Re: improve search results
How do I add this attribute if I use a form (customised template for the search form)?
Take for example the default templates / theme on the demo site.
the body_header.txp
form inserts the <txp:search_input />
tag and it automatically uses the search_input.txp
form. However if I add the match
attribute – it ignores
that form (and the HTML form construct it contains) for the front-end output and uses a very basic HTML form. But
<txp:search_input match="any" form="search_input" />
ignores the match attribute (that is, the search url is domain.test/?q=crazy+string
). ??
The one way I now found is adding this as a hidden
input into my form construct – inside search_input.txp
form:
<input name="m" type="hidden" value="any">
that does result in the expected domain.test/?m=any&q=crazy+string
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: improve search results
You’re right, Philippe.
Thank you so much: your solution is perfect and works well. 👌
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Re: improve search results
Pat64 wrote #333505:
You’re right, Philippe.
Thank you so much: your solution is perfect and works well. 👌
Thanks :)
BTW can someone with admin spellchecking powers correct the thread title
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: improve search results
phiw13 wrote #333504:
<txp:search_input match="any" form="search_input" />...
ignores the match attribute (that is, the search url is
domain.test/?q=crazy+string
). ??
Indeed, it only honours match
attribute when form=""
is set. Otherwise the care of m
input inside the form is left with the user, to avoid duplicates. Is it a bug? Dunno..
Offline
Re: improve search results
Bug maybe not, but it wasn’t at all clear from the documentation. If my attempt above is the way to go, that is perfectly fine with me. Thanks for the feedback.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: improve search results
phiw13 wrote #333506:
BTW can someone with admin spellchecking powers correct the thread title
Done.
Offline