Java Solrj查询两个日期异常
我使用了ApacheSolr4,我在新的Java Solrj查询两个日期异常,java,solr,solrj,Java,Solr,Solrj,我使用了ApacheSolr4,我在新的Solr,我想通过date chooser添加last\u modified,但是当我添加一些拥有自己的last\u modified的文档时,我会遇到异常。我得到了这个例外。 org.apache.solr.common.SolrException:请求错误 我添加了字段shema.xmllas_date,但现在我无法像这样查询范围两个日期 属性日期:[2013-01-00T20:00:00Z至2013-01-10T19:59:59Z] ,因为在sche
Solr
,我想通过date chooser
添加last\u modified
,但是当我添加一些拥有自己的last\u modified
的文档时,我会遇到异常。我得到了这个例外。
org.apache.solr.common.SolrException:请求错误
我添加了字段shema.xml
las_date
,但现在我无法像这样查询范围两个日期
属性日期:[2013-01-00T20:00:00Z至2013-01-10T19:59:59Z]
,因为在schema.xml
attr*格式中是String
public static void indexFilesSolrCell(String fileName, String solrId,String fileAuthor, String fileDate,String fileDescription, String fileTitle)
throws IOException, SolrServerException {
String urlString = "http://localhost:8983/solr";
SolrServer solr = new CommonsHttpSolrServer(urlString);
ContentStreamUpdateRequest up
= new ContentStreamUpdateRequest("/update/extract");
up.addFile(new File(fileName));
up.setParam("literal.id", solrId.replaceAll("\\s","").replaceAll("\\(","").replaceAll("\\)", ""));
up.setParam("literal.url", fileName);
up.setParam("literal.name", solrId);
up.setParam("literal.content_type",solrId);
up.setParam("uprefix", "attr_");
up.setParam("fmap.content", "content");
up.setParam("literal.owner",fileAuthor);
up.setParam("literal.last_modified", fileDate);
up.setParam("literal.description", fileDescription);
up.setParam("literal.title", fileTitle);
up.setAction(AbstractUpdateRequest.ACTION.COMMIT, true, true);
solr.request(up);
QueryResponse rsp = solr.query(new SolrQuery("*:*"));
}
如何将日期添加到文档中 应该有
<field name="las_date" type="date" indexed="true" stored="true" />
在你的schema.xml中,我知道,我添加了这个字段,但当我在两年之间时,它是正确的,但当我在两天之间时,我什么也得不到