-
AuthorPosts
-
September 20, 2014 at 1:38 am #201472
Hi,
I have a lyrics website with over 15K items in K2. My request is simple. I would like the keyword term search to be always “exact phrase” without the need for the user to put quotes and not portion of the word in non-latin lyrics. And the search applies to title, text, category and extra fields. I tried inall: but no use. It ignores extrafiCategory name may be skipped if it is hard to implement. I will have another module for extrafields only search and I want it should be all words or using OR. Still not sure, but all words means no changes, I guess.
My client is requesting a simple search textbox with a button. Results should be from the sources I mentioned. I have one extrafield group with 4 text of date, writer, composer and genre. If a visitor search for “Dr Dre”, results will show the song “Dr Dre is back” and songs written by Dr Dre, but not songs by Dr Alban or “Dre beats” song.
I am willing to make required changes in php for this. I have purchased AceSearch with commercial K2 plugin, yet still not doing what I need. So, I am depending on you guys.
Again, exact phrase, all selected fields (title, text and extrafields). How to do so?Thanks
Luna Garden ModeratorLuna Garden
- Join date:
- July 2011
- Posts:
- 2617
- Downloads:
- 80
- Uploads:
- 96
- Thanks:
- 78
- Thanked:
- 453 times in 425 posts
September 22, 2014 at 8:02 am #550354Hi,
Since we have added feature Advanced Keyword, so the Exact pharse, Any word, All words options were removed. You can read more about this feature here: http://www.joomlart.com/documentation/joomla-component/ja-k2-filter#version-113
<blockquote>I would like the keyword term search to be always “exact phrase” without the need for the user to put quotes and not portion of the word in non-latin lyrics.</blockquote>
<blockquote> If a visitor search for “Dr Dre”, results will show the song “Dr Dre is back” and songs written by Dr Dre, but not songs by Dr Alban or “Dre beats” song.</blockquote>
In latest version of JA K2 Filter, it got Ordering search result by relevance feature, the most suitable item with the query will be put on top of the search result. You can still get the item you want, here is the document link for relevance search: http://www.joomlart.com/documentation/joomla-component/ja-k2-filter#new-featureIf you still want it, we’ll help you to add custom code as your request. But some functions like search more than two keywords (for example: search “the cover of Newsweek” and “loose leaf”) … won’t work, and you can only search in all field, you can’t choose to search in specific field like in title, or title.
You can confirm here then we’ll post the code custom for you.
September 23, 2014 at 3:38 am #550452Yes, thank you. I only want one term search that works like user added quotes without adding quotes. The idea is to make it easy for the user to just enter either portion of lyrics or person (composer, writer..etc) then results will show as explained. Also, the search is slower when compared to ace search. I have around 16,000 somgs
Thanh Nguyen Viet FriendThanh Nguyen Viet
- Join date:
- September 2014
- Posts:
- 1461
- Downloads:
- 0
- Uploads:
- 44
- Thanked:
- 258 times in 217 posts
September 26, 2014 at 8:59 am #550833Hello,
Please try solution below, it will help to automatically enclose keyword search by quotes:
– Open the file:
components/com_jak2filter/models/itemlist.php– Find the code snippet below (it has some instance in the file, you need search for all):
[PHP]$search = JString::trim(JString::str_ireplace($badchars, ”, JRequest::getString(‘searchword’, null)));[/PHP]
– And add this code below after it:
[PHP]if(strpos($search, ‘”‘) === false) {
$search = ‘”‘.$search.'”‘;
}[/PHP] -
AuthorPosts
This topic contains 4 replies, has 3 voices, and was last updated by Thanh Nguyen Viet 10 years, 2 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum