{"id":20476873,"url":"https://github.com/askmike/jquery-search","last_synced_at":"2025-04-13T12:50:22.601Z","repository":{"id":2734838,"uuid":"3730353","full_name":"askmike/jQuery-Search","owner":"askmike","description":"A jQuery plugin that searches the page based on user input ","archived":false,"fork":false,"pushed_at":"2012-03-22T13:16:09.000Z","size":106,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T03:51:17.782Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/askmike.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-03-15T16:34:05.000Z","updated_at":"2014-06-21T14:35:21.000Z","dependencies_parsed_at":"2022-09-09T21:41:41.248Z","dependency_job_id":null,"html_url":"https://github.com/askmike/jQuery-Search","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/askmike%2FjQuery-Search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/askmike%2FjQuery-Search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/askmike%2FjQuery-Search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/askmike%2FjQuery-Search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/askmike","download_url":"https://codeload.github.com/askmike/jQuery-Search/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248717252,"owners_count":21150388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T15:24:14.435Z","updated_at":"2025-04-13T12:50:22.571Z","avatar_url":"https://github.com/askmike.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jQuery Search plugin\n\nSearch is a jQuery plugin that sets up a client sided word filter on an input field (for direct input by the user).\n\nIf you have lots of data on a page in a pre-defined structure Search will filter and sort all the data based on the input.\n\n## Demo\n\nCheck out the [online demo](http://mikevanrossum.nl/stuff/jQuery-Search/example.html).\n\n## How to use Search\n\nYou probably need to configure Search based on your page structure:\n\n    var settings = {\n    \tcontainer: '#templates', // selector to match the container that holds (nothing but) indexable items\n    \tsingle: '.single', // selector for the indexable items\n    \tsingleStructure: [ // the structure of each indexable item\n    \t\t{\n    \t\t\telem: 'h3',\n    \t\t\tscore: 3 // the importance of hits found in this element\n    \t\t},\n    \t\t{\n    \t\t\telem: 'textarea',\n    \t\t\tscore: 1\n    \t\t}\n    \t]\n    };\n\n    $('#filterInput').search(settings);\n\nNow you can filter using:\n\n* The input field (hit spacebar to submit)\n* `$(input).search(['word1', 'word2']);`\n* `$(input).search('word1 word2');`\n\n## Advanced\n\nSearch binds an keydown event to the input. Search checks for either an empty input field (reset) or a spacebar. \n\nYou can only bind Search to one input element at this moment, you can only bind the search once.\n\nWhen you pass either an object or nothing into Search it will only set up the filter based on the settings in the object, or the defaults (displayed above). When you pass either an array with words or a string with words (seperated by spaces) to Search it will set up the filter if this hasn't been done already and search on those words. It will also update the input field to reflect the query.\n\nAt the end of the filter process (and when we set the filter up) we take all the `single`'s off dom to manipulate (hide and sort) them all at the same time. Therefor you should be careful when binding stuff on those elements natively (and use `.on` or `.live` instead).\n\nWhen you search by accessing the function, Search returns the number of hits\n\n## Todo:\n\n* A way to re-initialize the filter\n\n## Author\n\nMike van Rossum, [The Next Web](http://thenextweb.com)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faskmike%2Fjquery-search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faskmike%2Fjquery-search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faskmike%2Fjquery-search/lists"}