Hi!

I'd like to have the possibility to (optionally) show the following fields also in Custom Search:

  • Containing any of the words
  • Containing the phrase
  • Containing none of the words

The fields above actually belong to the Core "advanced search form"

Thank you very much!

MXT

CommentFileSizeAuthor
#2 Test9.jpg139.81 KBmxt

Comments

jdanthinne’s picture

Status: Active » Fixed

Added in the DEV version.

mxt’s picture

StatusFileSize
new139.81 KB

I've just tried this feature and I've noticed a smull issue with javascript validation.

See image in attachment please.

My REAL opinion: if there is at least an input filter setted up, I don't see any reason to keep mandatory default "search" input (like core does and consequently Custom search module does.

A user is forced to insert a keyword: why?!?!?? It would be possible that a user can do a search only selecting an Input filters (e. g. like a taxonomy term, or an advanced search input filed). Not necessarily he have to know BEFORE what he's searching for, may be he only want to show all contents with a taxonomy term associated to.

So I'd change rules for validation: "if at least an input filter is setted up, the research can be done using that filter"

MXT

jdanthinne’s picture

Okay, I hadn't tested the javascript... damm!
Corrected it to DEV so only the default search field is highlighted.

For the other thing, unfortunately (and please correct me if I'm wrong!), Drupal can't search content without at least a keyword. That's how the default search works, and I can't rewrite the entire search system :-). You can try via the /search page, select a content type and/or a taxonomy term (in the advanced search) and hit Search and you'll see that Drupal will give you a message "You must include at least one positive keyword with 3 characters or more."

mxt’s picture

Yes, I know that we have to keep default search input mandatory due to drupal core search system (so that's why I've attached the first image).

My second opinion was to be intended as "general" and I think it would be a Drupal CORE task to resolve elsewhere.
Particularly, It's correct that the default input search form is mandatory when a user starts searching from this block area, but I think it wouldn't be mandatory when a user is already on the result page, and starts a search THERE, in the advanced search drupal core form, where other filters are present.

Do you think I have to signal this "issue" in the core issues?

jdanthinne’s picture

Yes, I think this belongs to core, not as an "issue", but perhaps a "feature request"?

D-Man’s picture

I'm a relatively non-tech web producer but have recently come across this issue on one of our clients' advanced search pages.

I wondered whether the need to add keywords when you have other filters could be 'hoodwinked' by adding hidden or default words to your free text, keywords field and then introducing an IF statement so those words would be used to index all of the content!?

So if the keyword box is always populated with - can this string be used as the default keyword for the command SEARCH EVERYTHING!!

(Obviously with a bit of trickery so that if you click on/off the field or reset to do a new search, it always populates with .

I think this should work, I just don't have the coding know-how to put it into action.

Feel free to shoot me down, dev world!! ;-)

jdanthinne’s picture

Well... in fact, I don't really understand what you mean!
There's so many terms : 'keywords', 'free text', 'keywords field', 'keyword box', 'default keyword', 'the field'....
Can you be more precise (perhaps with a mock-up, a screenshot with annotations, or a wireframe)?

Status: Fixed » Closed (fixed)

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

cuka2’s picture

Hi there, I agree with your article and I will be back to check it more in the future so please keep up your good quality work. I love your content & the way that you write. It looks like you've been doing this for a while now. You're great, this is a niche information.
Banking Info | Smart Review | Online Game Wallpaper | Budget News