Opensolr does not bill by the number of requests. It bills the bytes your index sends back. A tight query and a sloppy one cost the same to make, but not the same to answer.
One gigabyte of bandwidth is a million lean responses, or one heavy one. What you ask for decides which.
On a pre-paid plan you are billed for the outgoing bytes sent from your Opensolr index to your site or app. Nothing else. Not the number of queries, not the size of your index, not the traffic your own site receives.
Whoever reaches your search page, human or bot, triggers a query. The response coming back from the index is the part that counts.
- Bots and crawlers visit search pages far more than people do, and each visit becomes a query against your index.
- Heavy responses multiply that. A search page that returns full documents with every field makes every bot visit expensive.
- A sudden overnight spike is almost always a crawler loop or a scripted attack on the search page, not real visitors.
03 · How to send fewer bytes
Return only what you show
Use rows and fl so each answer carries the results and the fields the page displays, and nothing else. Returning 100,000 records to display 10 is the most common cause of a bandwidth spike.
/select?q=mysearch&rows=10&fl=id,title
Cache on your side
Keep search results in your own cache (Redis, Memcached, whatever your framework offers), so a page reload, an autocomplete keystroke or a back-button click does not query the index again.
Let the index narrow
Filter with fq and page through results, instead of fetching thousands of rows and filtering them in your code.
Split the traffic across two indexes
Bandwidth is counted per index. Replicate index A into index B and let your application query both in turn: two indexes, two monthly allowances.
Request log API
Query and facet the request log of your index by any field. Facet by IP and path to see exactly who uses the bandwidth: API: Get Index Request Log.
Query Analytics
Traffic over time, popular queries and slow queries, per index, in the control panel: Query Analytics.
Live Query Stream
Every request as it arrives, so a crawler loop or an attack shows the moment it starts: Live Query Stream.
05 · Monthly allowance and limit
Each index has its own monthly bandwidth from your plan. It starts again on the 1st of every month, you get an email at 90%, and an index over its allowance answers every request with 403 until it is back under. Details: bandwidth.