Question

I am using Solr for the first time to integrate my mobile app with Stubhub API. If you run this query in a browser, it runs fine:

http://www.stubhub.com/listingCatalog/select?q=+stubhubDocumentType:event%20AND%20city:seattle%20AND%20event_date:[NOW%20TO%20*]%20AND%20NOT%20totalTickets:0%20AND%20active:1;event_date_time_local%20asc%20&start=0&rows=50&fl=genreId+description%20event_id%20event_date_time_local channel

Notice that this query has a parameter for event_date which looks like this:

event_date:[NOW%20TO%20*] // '%20' is just the SPACE character

Instead of searching for everything from NOW to indefinitely in the future, when I want to search for only the current and next, I change the parameter as follows:

event_date:[NOW TO NOW/DAY+1DAY]

Doing this, the query does not work anymore. You can try it first hand in a browser yourself. What am I missing?

No correct solution

OTHER TIPS

Answer is simple. Just URL encode your + to %2B i.e. change

event_date:[NOW TO NOW/DAY+1DAY]

to

event_date:[NOW%20TO%20NOW/DAY%2B1DAY]

My query was fine only that therewas no data for 1 day. So, when I increased my time range from 1 day to 10 days, it worked! Stupid me. :P

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top