× If you expect answers you should describe your problem and give as much information's as possible. (SQL-Structure, Template Code, Joomla Version ...) Please read this before posting: joodb.feenders.de/support.html

joodb searchbox/fieldsname bug

  • kbondar.fas.harvard
  • Offline
More
11 years 6 months ago - 11 years 6 months ago #1151 by kbondar.fas.harvard
joodb searchbox/fieldsname bug was created by kbondar.fas.harvard
I have created {joodb searchbox/fieldsname} search with the dropdown menu for 4 fields. Once implemented there is another field - the first one in the dropdown menu called "All fields...". When you do a search and choose "All fields..." the search is perforded on only one fields 'Title-, name- or headlinefield:' field from the General Settings.
Questions:
First: how to make "All fields..." search through all the fields?
Second: if that is not possible how to remove "All fields..." from the dropdown menu?
Thank you
Last edit: 11 years 6 months ago by joest.

Please Log in to join the conversation.

More
11 years 6 months ago #1154 by Dirk
Replied by Dirk on topic Re: joodb searchbox/fieldsname bug
It's not really a bug. For security and speed reasons ALL FIELDS performs only a search in the main-fields (title,maintext,shorttext,date)

Please Log in to join the conversation.

  • kbondar.fas.harvard
  • Offline
More
11 years 6 months ago #1157 by kbondar.fas.harvard
Replied by kbondar.fas.harvard on topic Re: joodb searchbox/fieldsname bug
Is there a way to remove "All fields..." from the search filter dropdown menu?

Please Log in to join the conversation.

More
11 years 6 months ago - 11 years 6 months ago #1159 by Dirk
Replied by Dirk on topic Re: joodb searchbox/fieldsname bug

kbondar.fas.harvard wrote: Is there a way to remove "All fields..." from the search filter dropdown menu?


Not really. Because then the search will always be only over the selected field only.

1) You can rename "All fields..." something else using the override file.

translating-and-modifying-joomlas-language-files-using-language-overrides

2) You can manually rebuild the selector using searchbox without fieldlist. And hardcode a select element with name searchfield into your template.

Example
<select class="inputbox" name="searchfield">
  <option value="title">Title</option>
  <option value="value">Value</option>
  <option value="category">Category</option>
</select>

Be aware that then your user can search only in the selected element.
Last edit: 11 years 6 months ago by Dirk.

Please Log in to join the conversation.

  • kbondar.fas.harvard
  • Offline
More
11 years 6 months ago #1161 by kbondar.fas.harvard
Replied by kbondar.fas.harvard on topic Re: joodb searchbox/fieldsname bug
I have found "All fields" in the joodb.php file under components>com_joodb>helpers and replacde it with the field title on which the search is actually performed. It works but I found another problem. If you put two or less characters in the search it returns all results no matter what those two characters are. I actually have a field that contains just two characters and need to perform search on it but instead I get back all records as a search result.

Please Log in to join the conversation.

More
11 years 6 months ago #1163 by Dirk
Replied by Dirk on topic Re: joodb searchbox/fieldsname bug

kbondar.fas.harvard wrote: I have found "All fields" in the joodb.php file under components>com_joodb>helpers.


You must not change the helpers code directly. Otherwise your changes will be gone the next update. Use the manual way. Copy the complete code-block from the thml-page into your template instead of {joodb searchbox}. Remove the <options>All Fields</tag>.

kbondar.fas.harvard wrote: just two characters and need to perform search on it but instead I get back all records as a search result.


Thats also not a bug. If the string is to short dos-attacks to your site are very easy. Joomla limits the minimal search string length to at least 3 characters.

Please Log in to join the conversation.

Moderators: Dirkjoest