I am using ajax{} to make a GET request
part of the data attribute looks like this
data : q : 'pub_title:' + solrCompatableMainQuery,
solrCompatableMainQuery is input from a text box
the : in pub_title: gets converted to %3A (url encode) as it should.
However solrCompatableMainQuery needs to be surrounded by double quotes and these are not getting encoded
I have tried this
data : q : 'pub_title:' + '"' + solrCompatableMainQuery + '"',
and i have tried this (before the ajax call)
solrCompatableMainQuery = '"' + solrCompatableMainQuery + '"'
in both cases the "s etner dont appear in the URL or dont get encoded
interestingly i have tried adding them to the input
ie searching for "cars" rather than cars
and this does work!
the url produced contains the following
q=pub_title%3A"cats+dogs"
notice how the double quotes are NOT encoded and a + has been added
What is going wrong here