Questions tagged [bloodhound]

Bloodhound is the typeahead.js suggestion engine. It's robust, flexible, and offers advanced functionalities such as prefetching, intelligent caching, fast lookups, and backfilling with remote data.

Features

  • Works with hardcoded data
  • Prefetches data on initialization to reduce suggestion latency
  • Uses local storage intelligently to cut down on network requests
  • Backfills suggestions from a remote source
  • Rate-limits and caches network requests to remote sources to lighten the load

See the official documentation here.

280 questions
26
votes
3 answers

Typeahead.js - Search in multiple property values

Please see example below. JSFiddle: http://jsfiddle.net/R7UvH/2/ How do I make typeahead.js (0.10.1) search for matches in more than one property value? Ideally, within whole data (data.title, data.desc and in all data.category[i].name) …
Iladarsda
  • 10,640
  • 39
  • 106
  • 170
25
votes
1 answer

What is the difference between datum and query in bloodhound search engine?

So I am trying to build something using bloodhound search engine and I noticed that it has these two tokenisers, datum and query. The initializer code example given in the documentation looks like this: var engine = new Bloodhound({ local:…
user17282
  • 497
  • 5
  • 13
20
votes
2 answers

Typeahead v0.10.2 & Bloodhound - Working With Nested JSON Objects

UPDATE Based on the correct answer from @BenSmith (https://stackoverflow.com/users/203371/BenSmith) I was able to find my problem and found out I was not navigating through my JSON hierarchy properly. Here is the working code: // instantiate…
Jared
  • 2,443
  • 8
  • 26
  • 40
17
votes
2 answers

Understanding Bloodhound.tokenizers.obj.whitespace

All, I was trying to apply Twitter typeahead and Bloodhound into my project based on some working sample, But I can't understand below code . datumTokenizer: Bloodhound.tokenizers.obj.whitespace('songs'), queryTokenizer:…
Joe.wang
  • 11,537
  • 25
  • 103
  • 180
16
votes
2 answers

Typeahead and screenreaders

I am using Typeahead/Bloodhound to generate a list from the content of a database. I would like the bloodhound suggestions to be read by the screenreader when highlighted. I have added a few aria roles to the elements in an attempt to get the…
Carey Estes
  • 1,534
  • 2
  • 31
  • 59
14
votes
4 answers

typeahead, bloodhound : remote works but not prefetch

I want to use prefetch and I can't have it working ! Here is my code : function initAutocompletion() { $("input[data-autocomplete-prefetch-url]").each(function () { var $this = $(this); var urlPrefetch =…
boblemar
  • 1,143
  • 1
  • 10
  • 24
12
votes
1 answer

Duplicate records coming in typeahead search

I am implementing typeahead search using typeahaead.js but as type in typeahead searchbox, in suggestions dropdown each records is coming twice.I checked the datasource(that is POST api call),it has only unique records.where am I doing wrong?Any…
F11
  • 3,703
  • 12
  • 49
  • 83
11
votes
2 answers

Typeahead js with Bloodhound- this.source is not a function

I'm following this example for typeahead.js using Bloodhound to the T, but I'm getting a javascript error. What am I missing? HTML: (.net razor view) @Scripts.Render(Links.Scripts.typeahead_bundle_js)…
DLeh
  • 23,806
  • 16
  • 84
  • 128
11
votes
1 answer

Typeahead.js / Bloodhound display just one result

My Typeahead.js / Bloodhound (0.11.1) doesn't work as expected. Out of the long list of json results provided, only some are displayed as suggestions. For example, if I type los in my field, I get only Lostorf and nothing else, when there should be…
11
votes
5 answers

TypeAhead.js and Bloodhound showing an odd number of results

I have a TypeAhead/Bloodhound implementation in my frontend, that fetches JSON-data from a Play/Scala-server. Typeahead-version is 0.11.1. The implementation is as follows: HTML:
mpartan
  • 1,296
  • 1
  • 14
  • 30
11
votes
2 answers

Sort typeahead suggestions with the exact input at top

I am using Twitter typeahead.js 0.10.5 as a suggestion engine. It works great, with one exception, I can't sort the list of suggestions the way I want. As an example: var data =[{"id":1,"value":"no need"}, …
lunacafu
  • 357
  • 8
  • 20
9
votes
1 answer

Return values with Bootstrap's Typeahead displayKey Function

I have defined a custom template for suggestions in Bootstrap's Typeahead as mentioned below. But when I select any of the suggestions, I get only the country name in input. Since I have passed country in displayKey parameter. Is there anyway that…
geekowls
  • 627
  • 7
  • 17
8
votes
3 answers

How is error handling done with the new Typeahead with Bloodhound?

I have an issue in which Typeahead simply stops working when the user federated session expires. I would like to be able to perform an action when the "remote" call for Typeahead fails. How is this handled with Typeahead in particular? Is there…
TheDude
  • 1,421
  • 4
  • 29
  • 54
8
votes
1 answer

typeahead bloodhound custom headers

I would like to add a custom header into my bloodhound request, here is my code but it doesn't work. var datasource = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.whitespace, queryTokenizer: Bloodhound.tokenizers.whitespace, …
Viet Nguyen
  • 2,285
  • 2
  • 26
  • 43
8
votes
1 answer

Bootstrap Tokenfield with Typeahead / Bloodhound exclude tokens

I'm using bootstrap-tokenfield with typeahead/bloodhound. I can prevent the same token from being used twice in the tokenfield, but the same token still appears in the typeahead response. How can I exclude tokens that are already in the…
1
2 3
18 19