HideSeek icon indicating copy to clipboard operation
HideSeek copied to clipboard

Finding "male" within "female"

Open zforsman opened this issue 8 years ago • 5 comments

I'm not exactly sure how to phrase this, but I'm using HideSeek to search through some adoptable animals, and would like users to be able to search by gender. Out of the box, if a user types "male" this also finds "female", which in return displays all animals. Which makes sense based on the functionality.

Just curious if there is a way around this using one of the options?

Thanks!

zforsman avatar Apr 12 '17 21:04 zforsman

Hi, you can use the "matches" option in the latest version of HideSeek (v0.8.0) to exactly match a query to a result - here is an example.

Please let me know if that helped.

vdw avatar May 16 '17 07:05 vdw

Hi there, Finally got around to trying it out, but can't get it to work. "Female" now filters to only female results, but now "male" returns nothing. I am using attribute: 'title' if that makes any difference.

$( '#search' ).hideseek( {
   matches: {'^male$': '^male$'},
   nodata: 'There are no animals matching this criteria.',
   attribute: 'title'
} );

Thanks

zforsman avatar Jul 20 '17 17:07 zforsman

Can you provide the list you are using or a jsfiddle example?

vdw avatar Sep 21 '17 12:09 vdw

Am I able to search for content that is not in a list fomart? My website is shopimeals.epizy.com and I would like to be able to search all the restaurants in the "Popular" Section. How can I do it?

TwinArchelles avatar Aug 04 '19 18:08 TwinArchelles

@zforsman I know your question is ancient but it should be working regardless if you use attribute option or not. I have just tested it (I did it though on my forked version)

@TwinArchelles it actually has a "list". You can use ".inner-sec-w3layouts-agileinfo" as a data-list attribute and the search should be working. You can use attribute on items (as @zforsman) to provide better search abilities e.g. you can add "keywords" attribute on each item and inside put keywords for people to search, this way people would be able to find "JamaicanJerky" item when they search for "chicken" (as long you will add 'keywords="JamaicanJerky chicken"' attribute on it)

maxwroc avatar Aug 23 '19 14:08 maxwroc