documentcloud / visualsearch

A Rich Search Box for Real Data
http://documentcloud.github.com/visualsearch
MIT License
1.8k stars 237 forks source link

when using a value to populate the auto-complete menu #111

Closed sgeemd closed 10 years ago

sgeemd commented 11 years ago

Aloha, I'm a noob to javascript. I was wondering where in this example case 'account': callback([ { value: '1-amanda', label: 'Amanda' }, { value: '2-aron', label: 'Aron' }, { value: '3-eric', label: 'Eric' }, { value: '4-jeremy', label: 'Jeremy' }, { value: '5-samuel', label: 'Samuel' }, { value: '6-scott', label: 'Scott' } ]); break;

the user types 1,2,3,4 etc. but to return the value in the text box as Amanda not 1-amanda.

in the search_facet.js is where the value is set.. where is the value used to pull back the autocomplete. Thanks

samuelclay commented 10 years ago

The idea is that the search box matches perfectly what's being sent. I suppose this could change, but it's non-trivial and quite a departure from knowing that the query you see is the query that gets sent.