Skip to content

Rest Service

Matthew Davis edited this page Jul 15, 2023 · 3 revisions

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

Batch request

http://localhost:32192/query?&index=pubs&q=title:gene&rows=10&batch=true&batchSize=1000

Fields Rest

http://localhost:32192/fields?index=pubs

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

Terms Rest

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