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
2
votes
0 answers

Display a text insde input text with Bootstrap Tags Input

i've looking for a tags plugin frontend, and i found an awesome library called Bootstrap Tags Input and they are have a lot of example but i've problem when i trying to show the tags.text as a text and the tags.id as a value for input, which is my…
2
votes
0 answers

Typeahead.js not working on remote

The following code works perfectly fine. However, when saving the JSON as a separate file, it fails to work anymore. var customersData = [ { "id": "1", "name": "Stuart Smith" }, { "id": "2", "name": "James…
alvarolopez
  • 457
  • 6
  • 19
2
votes
1 answer

Typeahead with bloodhound remote suggestions

Here is my code: tagsProcessor(){ const suggestions = [{value: 'string1'}, {value: 'string2'}, {value: 'string3'}, {value: 'string4'}, {value: 'string5'}] var bloodhoundSuggestions = new Bloodhound({ datumTokenizer:…
stkvtflw
  • 12,092
  • 26
  • 78
  • 155
2
votes
1 answer

typeahead.js bloodhound minLength not working

I have implemented typeahead.js and bloodhound with a remote data source and it mostly works as expected. However, I have set the minLength on the typeahead to 2 and while I can see an ajax request fire after 2 characters (and 3), the typeahead only…
TimSpEdge
  • 49
  • 2
  • 9
2
votes
1 answer

Twitter Typeahead Bloodhound Remote Spring MVC Character Decoding Failed

I'm new to Twitter Typeahead (typeahead.js 0.11.1) and I'm trying to configure it with Thymeleaf + Spring MVC using the remote option. Here is my controller class: @Controller public class AutocompleteController { @Autowired private…
2
votes
0 answers

How can I filter results in typeahead.js using a second variable?

I am trying to filter results using Typeahead.js. I can currently filter the results using a field called activity_title. This works fine. How can I filter my results by a second value? In this case, I would like to select only the results that have…
user1517599
2
votes
1 answer

How do I reference the string being queried when defining sorter function of Bloodhound object? All my data is local

Here is a code snippet: var bloodhound_obj = new Bloodhound({ datumTokenizer: function(data) { var name = Bloodhound.tokenizers.whitespace(data.name); var id =…
Job
  • 43
  • 1
  • 5
2
votes
0 answers

In Typeahead.js, can you tell if you have more results than the limit?

By default, Bloodhound limits the results returned to Typeahead.js to 5. This value is adjustable with the 'limit' option in Bloodhound. Is there any indicator to tell that a Bloodhound received more results than its limit? Example being: Bloodhound…
friggle
  • 3,362
  • 3
  • 35
  • 47
2
votes
1 answer

Including Typeahead.js Bloodhound with Browserify gives empty object {}

I'm trying to use Bloodhound and Typeahead in my Browserify project. I'm using browserify-shim. package.json { ... "browserify": { "transform": ["browserify-shim"] }, "browserify-shim": "./shim.js", } shim.js module.exports…
2
votes
1 answer

Typeahead search suggestions undefined - Remote Ajax

I am trying to make the typeahead remote source to a web method which will be repsond with results in JSON format. Ajax is getting success and it;s returing the results properly . The console in the below code will print like below…
Midhun Murali
  • 2,089
  • 6
  • 28
  • 49
2
votes
1 answer

TypeAhead and Bloodhound only searching on first words in JSON array

I'm using TypeAhead to provide autocomplete results for a textbox. But it seems either Bloodhound or TypeAhead is only searching on the first words of found in the JSON array I'm providing. The JSON looks as follows: [ { "name":…
Anriëtte Myburgh
  • 13,347
  • 11
  • 51
  • 72
2
votes
0 answers

Typeahead.js transport stop firing after a while

I'm using Typeahead.js v0.10.4 with Bloodhound remote option. It works as I expected for a while, but hitting a lot of backspace and typing again just stop all functionality. I made a tiny test for this: var bhOptions = { datumTokenizer:…
SubZtep
  • 31
  • 1
  • 4
2
votes
1 answer

What is a proper way to handle exceptions thrown by typeahead/Bloodhound code?

If data is not available in server or server error occurs or server data is null javascript throws exception obj is null. How to catch this exception? Search in stackoverflow did not give any results. Here's the code: var test1 = new Bloodhound({ …
yW0K5o
  • 913
  • 1
  • 17
  • 32
2
votes
0 answers

bootstrap typeahead search on multiple data keys

airports.js contains the following data structure: [{"code": "LGW", "name": "Gatwick Airport", "location": "London, UK"}, {"code": "LHR", "name": "Heathrow Airport", "location": "London, UK"}] A search for 'Gatwick' returns the following result:…
Andy
  • 454
  • 2
  • 7
  • 22
2
votes
0 answers

Setting Bloodhound remote filter to results of ajax calls made from within filter

I'm using Bloodhound's remote option to provide suggestions to a Typeahead autocomplete in Typeahead.js 0.10.2. Everything is working fine when I make a single ajax request using remote's url option; I can use the filter option to manipulate the…
BrianT1000
  • 21
  • 1
  • 3