Source:
<code>private List<Fieldable> toLuceneFields(HttpCacheEntry entry) throws IOException { List<Fieldable> fields = new ArrayList<>(); fields.add(new Field(FIELD_REQUEST_DATE, Long.toString(entry.getRequestDate().getTime()), Store.YES, Index.NO)); fields.add(new Field(FIELD_RESPONSE_DATE, Long.toString(entry.getResponseDate().getTime()), Store.YES, Index.NO)); StatusLine statusLine = entry.getStatusLine(); fields.add(new Field("statusLine/statusCode", Integer.toString(statusLine.getStatusCode()), Store.YES, Index.NO)); fields.add(new Field("statusLine/reasonPhrase", statusLine.getReasonPhrase(), Store.YES, Index.NO)); ProtocolVersion protocolVersion = statusLine.getProtocolVersion(); fields.add(new Field("statusLine/protocolVersion/protocol", protocolVersion.getProtocol(), Store.YES, Index.NO)); fields.add(new Field("statusLine/protocolVersion/major", Integer.toString(protocolVersion.getMajor()), Store.YES, Index.NO)); fields.add(new Field("statusLine/protocolVersion/minor", Integer.toString(protocolVersion.getMinor()), Store.YES, Index.NO)); Header[] headers = entry.getAllHeaders(); for (int index = 0; index < headers.length; index++) { Header header = headers[index]; fields.add(new Field("headers/" + index + "/" + header.getName(), header.getValue(), Store.YES, Index.NO)); } fields.add(new Field("body", IOUtils.toByteArray(entry.getResource().getInputStream()))); Date date = entry.getDate(); if (date != null) { <START> fields.add(new Field("date", Long.toString(date.getTime()), Store.YES, Index.NO)); <END> } for (Entry<String, String> variant : entry.getVariantMap().entrySet()) { fields.add(new Field("variant/" + variant.getKey(), variant.getValue(), Store.YES, Index.NO)); } return fields; }</code><technical_language>this needs there. This duplicates a header. Also, HttpCacheEntry's constructor accept "date" Date, "request/responseDate"</technical_language>

Target:
private List<Fieldable> toLuceneFields(HttpCacheEntry entry) throws IOException { List<Fieldable> fields = new ArrayList<>(); fields.add(new Field(REQUEST_DATE_FIELD_NAME, Long.toString(entry.getRequestDate().getTime()), Store.YES, Index.NO)); fields.add(new Field(RESPONSE_DATE_FIELD_NAME, Long.toString(entry.getResponseDate().getTime()), Store.YES, Index.NO)); StatusLine statusLine = entry.getStatusLine(); fields.add(new Field(STATUS_CODE_FIELD_NAME, Integer.toString(statusLine.getStatusCode()), Store.YES, Index.NO)); fields.add(new Field(REASON_PHRASE_FIELD_NAME, statusLine.getReasonPhrase(), Store.YES, Index.NO)); ProtocolVersion protocolVersion = statusLine.getProtocolVersion(); fields.add(new Field(PROTOCOL_FIELD_NAME, protocolVersion.getProtocol(), Store.YES, Index.NO)); fields.add(new Field(MAJOR_PROTOCAL_VERSION_FIELD_NAME, Integer.toString(protocolVersion.getMajor()), Store.YES, Index.NO)); fields.add(new Field(MINOR_PROTOCOL_VERSION_FIELD_NAME, Integer.toString(protocolVersion.getMinor()), Store.YES, Index.NO)); Header[] headers = entry.getAllHeaders(); for (int index = 0; index < headers.length; index++) { Header header = headers[index]; fields.add(new Field(HEADER_FIELD_NAMES + index + "/" + header.getName(), header.getValue(), Store.YES, Index.NO)); } fields.add(new Field(BODY_FIELD_NAME, IOUtils.toByteArray(entry.getResource().getInputStream()))); if (entry.hasVariants()) { for (Entry<String, String> variant : entry.getVariantMap().entrySet()) { fields.add(new Field(VARIANT_FIELD_NAMES + variant.getKey(), variant.getValue(), Store.YES, Index.NO)); } } return fields; }