REST
Query Rest
The parameter pretty=false can be added to create compressed output on many of the calls
Simple Query
http://localhost:32192/query?&index=pubs&q=title:gene&rows=10
Simple Query in csv
http://localhost:32192/query?&index=pubs&q=title:gene&rows=10&format=csv&fl=id&fl=title
Return Fields
http://localhost:32192/query?&index=pubs&q=title:gene&rows=10&fl=title
Filter Fields Returned
http://localhost:32192/query?&q=title:gene&rows=10&fl=-doi&fl=-abstract
Facet
http://localhost:32192/query?&index=pubs&facet=issn
Facet (More Results)
http://localhost:32192/query?&index=pubs&facet=issn:100
Facet Drill Down
http://localhost:32192/query?&index=pubs&facet=issn:100&drillDown=issn:1234-1234
Query Fields
http://localhost:32192/query?&index=pubs&q=cancer&qf=title&qf=abstract&rows=10
Minimum should match / Default Query Operator Example
http://localhost:32192/query?&index=pubs&q=gene biology genotype&qf=title&qf=abstract&mm=2&defaultOp=OR&rows=10
Sort
Can use -1/DESC or 1/ASC and multiple sort parameters to sort on for example title and then date
http://localhost:32192/query?&index=pubs&sort=title:-1&rows=10
Filter Query
http://localhost:32192/query?index=pubs&q=*:*&fq=title:cancer&rows=10
Advanced Filter Query
http://localhost:32192/query?index=pubs&q=*:*&fqJson={q:"cancer diabetes genes",defaultOp:OR,mm=2,qf=["title","abstract"]}&rows=10
Score Function Query
Score functions are passed via the qJson parameter using the protobuf JSON format:
http://localhost:32192/query?index=pubs&rows=10&qJson={"queryType":"SCORE_MUST","q":"title:gene","scoreFunction":"zuliaScore * popularity"}
Multiple query clauses can be combined using multiple qJson parameters:
http://localhost:32192/query?index=pubs&rows=10&qJson={"queryType":"SCORE_MUST","q":"title:gene","qf":["title"],"scoreFunction":"zuliaScore * (1 + ln(pageRank))"}&qJson={"queryType":"FILTER","q":"year:[2020 TO *]"}
See [[Query-Syntax#Score-Functions]] for the full expression reference.
Realtime Query
Triggers an NRT (Near Real-Time) refresh to include recently stored but uncommitted documents in the results.
http://localhost:32192/query?index=pubs&q=title:gene&rows=10&realtime=true
Debug
Logs the parsed and rewritten Lucene query for each shard in the server logs. Useful for troubleshooting query behavior.
http://localhost:32192/query?index=pubs&q=title:gene&rows=10&debug=true
Concurrency
Sets the number of virtual threads used for parallel segment search within each shard. Defaults to the index or node-level defaultConcurrency setting if not specified.
http://localhost:32192/query?index=pubs&q=title:gene&rows=10&concurrency=4
Cursor Pagination
Cursor pagination provides constant-time paging regardless of depth. A sort on a unique field or unique combination is required, especially on a changing index where documents may be added or updated between pages.
Start pagination with cursor=0:
http://localhost:32192/query?index=pubs&q=title:gene&rows=10&sort=id:1&cursor=0
The response includes a cursor field (Base64-encoded token). Pass it back to get the next page:
http://localhost:32192/query?index=pubs&q=title:gene&rows=10&sort=id:1&cursor=CgwKCW15aW5kZXgS...
Repeat until the results array is empty.
Batch request
Batch mode streams all results as CSV using cursor pagination internally. A sort is required.
http://localhost:32192/query?&index=pubs&q=title:gene&rows=10&batch=true&batchSize=1000
Fields Rest
http://localhost:32192/fields/pubs
The query parameter style is also supported but the path-based style above is preferred:
http://localhost:32192/fields?index=pubs
Realtime Fields
http://localhost:32192/fields/pubs?realtime=true
Indexes Rest
http://localhost:32192/indexes
Index Schema Rest
http://localhost:32192/index?index=someIndex
Nodes Rest
http://localhost:32192/nodes
Stats Rest
http://localhost:32192/stats
Fetch Rest
http://localhost:32192/fetch?index=pubs&id=13442
Realtime Fetch
http://localhost:32192/fetch?index=pubs&id=13442&realtime=true
Terms Rest
All terms endpoints also accept realtime=true to include uncommitted changes.
All Terms for a field
http://localhost:32192/terms?index=pubs&fl=title
Terms with CSV Format (Starting in 0.52)
http://localhost:32192/terms?index=pubs&fl=title&format=csv
Terms With Minimum Term Frequency
http://localhost:32192/terms?index=pubs&fl=title&minTermFreq=5000
Fuzzy Match of Terms (Starting in 0.52)
http://localhost:32192/terms?index=pubs&fl=abstract&fuzzyTermJson={term:"gene",editDistance:1,prefixLength=3}
Limit Terms
http://localhost:32192/terms?index=pubs&fl=title&minDocFreq=1000&amount=20
Range of Terms
http://localhost:32192/terms?index=pubs&fl=title&startTerm=cancer&endTerm=cells
Specific Terms
http://localhost:32192/terms?index=pubs&fl=abstract&includeTerm=cancer&includeTerm=gene
Associated Rest
To Fetch
http://localhost:32192/associatedDocs?index=someIndex&id=123&fileName=readme.txt
To Store
Same url as POST instead of GET
http://localhost:32192/associatedDocs?index=someIndex&id=123&fileName=readme.txt
Show All
http://localhost:32192/associatedDocs/all?index=someIndex
Health Rest
Returns the health status of the Zulia node including CPU usage, memory usage, disk space, and MongoDB connectivity (cluster mode only). Each indicator reports UP, DEGRADED, or DOWN with detailed metrics.
Example Usage
curl http://localhost:32192/health
Example response:
{
"name": "zulia-service",
"status": "UP",
"details": {
"cpuUsage": {
"name": "zulia-service",
"status": "UP",
"details": {
"system": "13.67%",
"systemAlertThreshold": "90.01%",
"jvm": "0.93%",
"jvmAlertThreshold": "80.00%",
"numProcessors": 16
}
},
"memoryUsage": {
"name": "zulia-service",
"status": "UP",
"details": {
"memoryUsed": "131.8 MiB",
"memoryMax": "30 GiB",
"memoryCommitted": "160 MiB",
"memoryPercent": "0.43%",
"thresholdPercent": "90.00%"
}
},
"compositeDiscoveryClient()": {
"name": "zulia-service",
"status": "UP",
"details": {
"services": {
}
}
},
"service": {
"name": "zulia-service",
"status": "UP"
},
"diskSpace": {
"name": "zulia-service",
"status": "UP",
"details": {
"total": 7998551654400,
"free": 7447839285248,
"threshold": 1073741824
}
},
"deadlockedThreads": {
"name": "zulia-service",
"status": "UP"
},
"mongoStatus": {
"name": "zulia-service",
"status": "UP",
"details": {
"statusDetails": "Able to connect to Mongo instance"
}
},
"gracefulShutdown": {
"name": "zulia-service",
"status": "UP",
"details": {
"activeTasks": 2
}
}
}
}