Solr查询参数omitHeader 忘是亡心i 2022-07-13 01:17 162阅读 0赞 **摘要:** 参数omitHeader用来指定是否返回查询的Header信息。 > 这个参数只有两个可选值,true和false。 ## 设置为true ## 参数指定为`omitHeader=true`,将会隐藏header信息。使用如下的HTTP请求 `http://localhost:8080/solr/core/select?indent=on&q=*:*&wt=json&omitHeader=true` 返回: { "response":{"numFound":106,"start":0,"docs":[ { "id":"c3812fee-de7a-48e5-a60d-79a882aca823", "title_s":"皇帝讽刺剧", "artist_s":"鲍勃·迪伦", "country_s":"美国", "company_s":"哥伦比亚", "price_d":10.9, "year_s":"1985", "type_s":"光盘", "description_s":"夏天的午后听Bob Dylan的歌特别容易被催眠", "_version_":1551502047719718912 }, ... ] } } ## 设置为false ## 默认值为false,将会返回header信息,这个header会包含一些请求信息,比如查询参数,查询花费的时间等。使用如下的HTTP请求 `http://localhost:8080/solr/core/select?q=*:*&wt=json&omitHeader=false` 等同于 `http://localhost:8080/solr/core/select?q=*:*&wt=json` 返回: { "responseHeader":{ "status":0, "QTime":0, "params":{ "q":"*:*", "omitHeader":"false", "wt":"json"}}, "response":{"numFound":106,"start":0,"docs":[ { "id":"c3812fee-de7a-48e5-a60d-79a882aca823", "title_s":"皇帝讽刺剧", "artist_s":"鲍勃·迪伦", "country_s":"美国", "company_s":"哥伦比亚", "price_d":10.9, "year_s":"1985", "type_s":"光盘", "description_s":"夏天的午后听Bob Dylan的歌特别容易被催眠", "_version_":1551502047719718912 }, ... ] } }
还没有评论,来说两句吧...