Combined search
-
Is it possible to combine term search and keyword search in the same text field? I would like to get a search with one text field that searches one or more words from alt-text, title and attachment tags.
-
Good to hear from you again, and thanks for the question. You can use the parameters described in the “Keyword(s) Search” section of the Settings/Media Library Assistant Documentation tab to get a good solution. Here is an adaptation of the “Search Form and Gallery” example in the Documentation to get you started:
<form id="mla-search-form" action="." method="post"> <input id="mla-search-box" name="search-string" type="text" value="" /> <input id="submit" name="submit" type="submit" value="Search" /> </form> [mla_gallery s="{+template:({+request:search-string+}|a-bad-term)+}" mla_nolink_text="Enter a search value above to display gallery." mla_search_fields="alt-text,title,terms" mla_terms_taxonomies=attachment_tag mla_search_connector=OR]
If your terms have multiple words separated by spaces, you can match on multi-word phrases in a variety of ways. These are described in detail, with examples, in the “Entering Words and Phrases” portion of the “Terms Search – filtering on taxonomy term names” Documentation section. You can also use the
whole_word=true
,sentence=true
andexact=true
parameters to change the matching logic used in the[mla_gallery]
shortcode.I am marking this topic resolved, but please update it if you have problems or further questions regarding the above suggestions. Thanks for your continued interest in the plugin.
Never got it to work and finally installed Ivory search that seemed to work at firrst. Now it only finds like 1 or 2 or nothing, when there are tens or hundreds of attachments with same tags. I just want a search that would work like the MLA Medias backend search. I used another search plugin before and it also worked at first and then the results got limited, also I started to get resources limited errors. Now with Ivory search the same thing.
- This reply was modified 5 months, 3 weeks ago by bhasic.
Thanks for your update. I regret that you’re still having trouble with this application.
You wrote “I just want a search that would work like the MLA Medias backend search.” Do you mean the Search Media function on the Media/Assistant admin screen? Do you mean that the Search Media function gives different results than the Keyword(s) search on the shortcode? If that’s true I can investigate further.
You wrote “there are tens or hundreds of attachments with same tags“. Is the problem specific to the taxonomy terms, i.e., are the ALT Text and Title searches working properly? If so, have you tried the “Taxonomy term keyword(s) search” function? Here’s an example of that alternative:
[mla_gallery mla_terms_phrases="{+template:({+request:search-string+}|a-bad-term)+}" mla_nolink_text="Enter a term(s) search value above to display gallery." mla_terms_taxonomies=attachment_tag mla_phrase_connector=OR]
The terms search can’t be combined directly with the keywords search, but knowing that it works would give me more information.
I am happy to keep working on this if it would be of use. Post an update if you want to keep at it.
The problem is that I have a term list and a search. In the search results I need to have image tags shown with each result. Ivory search and Media search enhanced do what I need and both worked for a while, but now results are limited for some reason.
I want the search to search for tags AND titles, alt-texts, categories.
My code:
[mla_term_list taxonomy=attachment_category include_tree=63 mla_link_href="{+page_url+}?term_slug={+slug+}&current_name={+name,url+}" mla_rollover_text='\n' mla_output=flat show_count=true separator=' | '] <h4>[mla_gallery add_filters_to=any post_parent=all ids=1 mla_nolink_text="{+template:(Items for category {+request:current_name+})+}"]</h4> [mla_gallery add_filters_to=any post_parent=all orderby=date order=DESC attachment_category="{+template:({+request:term_slug+}|In English)+}" post_mime_type="image,video" posts_per_page=10 mla_nolink_text="Select a category."] [mla_gallery add_filters_to=any post_parent=all attachment_category="{+template:({+request:term_slug+}|In English)+}" posts_per_page=10 mla_output="paginate_links,prev_next" mla_link_href="{+page_url+}?term_slug={+request:term_slug+}" post_mime_type="image,video" mla_style=km mla_markup=km]
Ivory search + MLA is useless with multiple search terms. If I search “comic” I get almost 1000 results. If I search “maga” I get 1500 results. If i search “comic maga” I get 2250 results and most aren’t even comic or maga related. I don’t think Ivory search is meant to be so bad and it has something to do with MLA.
You wrote “I want the search to search for tags AND titles, alt-texts, categories.” I understand that; my suggestion to try the Taxonomy Term Keywords search was an experiment to gather more information so I can investigate further. My question regarding the Media/Assistant search function is also an attempt to gather more information.
I regret that you were distracted by problems with your cache plugin(s). Are you still using a cache plugin and, if so, which one? Do the results improve if the cache plugin is disabled?
I have no experience with Ivory Search and do not know if or how it interacts with MLA. If you can give me more details on how you use it I can install it and run some tests.
Thanks for your patience and any additional details you can provide.
Cache plugin is now working properly and it disabled I get the same results. I can give you admin access to my site if you want to look at it. MLA’s search seems to be out of the question because I’m using term list also. I had another thread about it before, but had another try anyway. The Ivory search’s problem seems to be the same that I had with another search plugin. Wp-debug and wp-debug-log are on and there’s nothing in there. I have tried disabling all other plugins, no change.
Thanks for your offer to access your system, but WordPress rules specifically and strongly prohibit me from requesting or using any access to your site.
If you can answer the questions I included in my earlier posts it might give me a clue on how to proceed. In the absence of any more information I regret that I’ve given you all the help I can. Thanks for your understanding.
- You must be logged in to reply to this topic.