I've noticed that filters doesn't works as expected:

I have 3 vocaboularies and I made this test:

- I searched for a word I'm sure exists in my contents
- I choose taxonomy terms from taxonomy filters. These terms I'm sure are not connected to the word I put in the input field

Results display anyway content containing the word I searched, regardless taxonomy filters I've setted up

I did the same test with CORE advanced search form and no results were shown, as expected.

It seems like the search query utilize OR instead of AND to concatenate filters.

Thank you!

MXT

CommentFileSizeAuthor
#23 Test8.jpg244.18 KBmxt
#20 search.png106.89 KBjdanthinne
#18 Test7.jpg296.26 KBmxt
#14 Test6.jpg370.64 KBmxt
#13 Test5.jpg279.65 KBmxt
#12 Test4.jpg627.01 KBmxt
#7 withoutfilters.png102.33 KBjdanthinne
#7 withfilters.png109.64 KBjdanthinne
#6 Test3.jpg234.97 KBmxt
#4 Test1.jpg414.75 KBmxt
#4 Test2.jpg241.17 KBmxt
#3 multiple-taxonomy.patch882 bytesjdanthinne

Comments

jdanthinne’s picture

Status: Active » Postponed (maintainer needs more info)

Hi,
Can you tell me how the custom search taxonomy settings are configured (screenshot), and a concrete example of content and what you're typing in the search box and what is the url generated for the resulting search results page.
Thanks.

jdanthinne’s picture

Status: Postponed (maintainer needs more info) » Needs work

Ok, I've found what's the problem. The taxonomy filter doesn't work when there's more than one taxonomy filter enabled... I'm working on it!

jdanthinne’s picture

Status: Needs work » Patch (to be ported)
StatusFileSize
new882 bytes

Can you try this patch? It corrects a bug with multiple taxonomy vocabularies.

But I don't know if it corrects the OR/AND problem, because I'm using the default Drupal search behaviour, so try the default Drupal advanced search and then the custom search and compare the results.

mxt’s picture

StatusFileSize
new241.17 KB
new414.75 KB

In can't apply the patch because it's already available in the latest DEV version (I hope I'm not wrong...)

Anyway I've attached 2 images to explain the issue better.

Thank you very much for your work

MXT

jdanthinne’s picture

Ok, please try the latest dev version. And tell me if it works better for you, and tell me what is the url generated when you hit "Search" with test1.jpg

mxt’s picture

StatusFileSize
new234.97 KB

I tried latest DEV version: already taxonomy filters aren't transfered in the query string (see image in attachment).

MXT

jdanthinne’s picture

StatusFileSize
new109.64 KB
new102.33 KB

Mmm... this is really strange...
I've just reinstalled the very last dev version (from today 22 March) on a fresh drupal install, added content in the same way as you, tested it, and taxonomy is passed in the url (see screenshots).

mxt’s picture

I tried with a clean installation too and the issue doesn't happen.

So, at this point, I think there is some conflict with other modules/settings I have in my site.

The first suspicious module is "Search config" that i use to reduce content indexing only to content type I need, and to hide all content type in the search options only to one content type.

I'll take some check and will report here

Thank you for the moment

mxt’s picture

Deactivating the "search config" module the issue doesn't happen: so there is a conflict with this module.

Notice that I must use "search config" for this reason:

1) It allow to reduce content indexing only to content type I need (e.g. only content type "article" is indexed, while "content type "department" is not indexed - > excluded from search results)

2) It allow to hide particular content types filter options in the advanced search form

How can we proceed?

jdanthinne’s picture

Status: Patch (to be ported) » Needs work

Mmm... I think this other module is the problem.
I need to check how it works and how I can remove this conflict (I think it has to do with the order Drupal runs the two modules, so I suppose I have to change my module's "weight").
I get back to you as soon as possible.

jdanthinne’s picture

I've just enabled "search config", and everything still works fine.
How have you configured this module? Which options have you enabled/disabled?

mxt’s picture

StatusFileSize
new627.01 KB

Please see image in attachment to view my settings.

Anyway I tried to "reset to default" but the issue is always present, regardless settings I make.

I don't know what to think...

mxt’s picture

StatusFileSize
new279.65 KB

I noticed that if I write the entire querystring in the input field, the querystring itself is transfered correctly to the core form.

(see image in attachment)

mxt’s picture

StatusFileSize
new370.64 KB

Perhaps I have found the problem.

Drupal CORE search offer 2 types of search form:

1) Block search form (placed in blocks)

2) Theme search form (place directly in your site template, e.g page.tpl.php)

Well, only Block search forms works correctly in a "custom-search - serach-config" modules context.

It seams that using Theme search forms additional taxonomy filters setted up with custom search module are not transfered to the querystring.

Is this issue solvable?

(please see image in attachment)

jdanthinne’s picture

Thanks for your investigation!!
Now that I know that it works in blocks, I can concentrate on why it doesn't work with theme search form.
I get back to you as soon as I have some time to understand why…

jdanthinne’s picture

Status: Needs work » Fixed

Ok, I fixed the problem and commited the patch to -dev.
In fact, in the "theme version", search_config is doing some stuff and no other module can interfer with search.
I've increased my module weight, so it runs after search_config, and works as needed.

jdanthinne’s picture

And don't forget to run update.php, the fix is done there.

mxt’s picture

StatusFileSize
new296.26 KB

Ok things works better now, but still there is an issue: if a taxonomy filter is setted to "any", other taxonomy filters setted up weren't transfered to the querystring (no matter if the form is "theme" or "block").

See image in attachment

Thank you for your work!

jdanthinne’s picture

Status: Fixed » Needs work
jdanthinne’s picture

StatusFileSize
new106.89 KB

Strange once more, because it's working fine here on my clean install, with search config enabled et configured like you. Have you any other module enabled dealing with search?
Not easy to find the problem without having access to your site.

mxt’s picture

Using "one choice" drop down like you things works right, have you tried using "drop down with multiple choices" for taxonomy like me?

jdanthinne’s picture

You're right, multiple choices is guilty.
Working on it…

mxt’s picture

StatusFileSize
new244.18 KB

Also I've noticed that terms indentation is not kept using multiple choices drop down lists.

jdanthinne’s picture

Status: Needs work » Fixed

Just fixed those two problems (indentation and multiple choices) in DEV.
Nasty ones!

mxt’s picture

YEAH! Seem all work fine now!

THANK YOU VERY MUCH FOR YOUR WORK!!!

MXT

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.