I'm using combo of Python and Django, and JS libraries bloodhound and typeahead to form an incremental search box on a website. In the js so far I've included the URL of the remote Solr server so that the js can fire queries at it to populate the search box as the user types. The thing that occurs to me is I might prefer not to make this Solr URL visible to the user should they view the source and the JS script. Is it possible to do this? Perhaps there is a better way of achieving this altogether... I've copied the relevant bit of code below and you can see the URL of the Solr server is visible in the script:
// construct suggestion engine
var engine = new Bloodhound({
datumTokenizer: function (datum) {
return Bloodhound.tokenizers.whitespace(datum.title);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
remote: {
url: 'http://localhost:8983/solr/document_core/select?wt=json&q=%QUERY',
wildcard: '%QUERY',
filter: function (data) {
return $.map(data.response.docs, function (suggestionSet) {
return{
title : suggestionSet.title,
category : suggestionSet.category
}
});
}
}
});
Many thanks for any help!