Skip Navigation

[Resolved] Search with multiple keywords

This thread is resolved. Here is a description of the problem and solution.

Problem:
Client is using Relevanssi for custom text searches, but searching for codes such as "A:66" or "C:53" doesn't work.

Solution:
It appears to be a limitation of Relevanssi where searches are broken by the colon. Searches for "A66" or "C53" do work.

This is not related to the Relevanssi - Toolset integration.

This support ticket is created 6 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 4 replies, has 2 voices.

Last updated by Nigel 6 years, 4 months ago.

Assisted by: Nigel.

Author
Posts
#919872

I am trying to setup a filter where the user will be able to enter multiple search keywords.
Either separated by , or separated with + or other key.

Tried: Field "book-space" is a string that is "in" URL parameter "yta" and tried to use , as a separator but it did not work.

I tried the text search and added the field to relevanssi but I does not return the posts. Can this be due to that the field contains ":" and ";"?

Sample field value: "A:017"

#919902

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Tina

The default search with Relevanssi is an OR operator for each of the search words.

I'm not sure why you are talking about separating keywords with , or + or other texts.

Can you give me some examples of what people might be searching for, and why the default space separator isn't appropriate?

A cursory reading of the Relevanssi documentation doesn't suggest any alternatives (other than combining search words with AND).

#919976
posts.png
filter.png
search.png
the field value before search.png
no posts found.png

Well, I tried the standard search field (relevanssi) but for some reason it doesn't work on this page. It does on other pages ...
So I thought I'd go about it in another way ...

Attaching images to be more clear on what happens when I try to use the normal search field.
(the field is added to Relevanssi and I rebuilt the index)

Apart from the images, this is the url that the search generates:
hidden link
&dt=1534694400
&wpv_aux_current_post_id=6808
&wpv_aux_parent_post_id=4249
&wpv_view_count=6803-TCPID6808CPID4249
&wpv_post_search=A%3A06

#919991
wrong post.png

Addition to my last reply, I notised that it doesn't work as it should on other pages either.
Searching for A:05 returns A:03
(A:05 does exist).
See image.

#920306

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Tina

I set up a text search with Relevanssi on a local test site and I added a custom field where I saved values such as A:03, B:99 and C88.

I found that searching for C88 worked, whereas searching for either A:03 or B:99 did not.

Editing the field with B:99 and changing it to B99 then searching for it found the post.

I then used the standard WordPress search form rather than the text search in a View and found the same.

So it seems to be an issue with Relevanssi and how it stores the index for such custom fields.

I'd try speaking to them to see if there is anything to be done about it.

If it doesn't work from a standard WordPress search field it won't work from a View search.