Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finding "male" within "female" #50

Open
zforsman opened this issue Apr 12, 2017 · 5 comments
Open

Finding "male" within "female" #50

zforsman opened this issue Apr 12, 2017 · 5 comments

Comments

@zforsman
Copy link

zforsman commented Apr 12, 2017

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!

@vdw vdw added the question label Apr 24, 2017
@vdw vdw added the enhancement label May 7, 2017
vdw added a commit that referenced this issue May 15, 2017
Matches user's query and data against regular expressions.

Ref.: #50
@vdw
Copy link
Owner

vdw commented May 16, 2017

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.

@zforsman
Copy link
Author

zforsman commented Jul 20, 2017

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

@vdw
Copy link
Owner

vdw commented Sep 21, 2017

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

@TwinArchelles
Copy link

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?

@maxwroc
Copy link

maxwroc commented Aug 23, 2019

@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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants