Page tree
Skip to end of metadata
Go to start of metadata

The StoredField   expression requests that a field from the matching record be returned in the response document.

Java Example:

QueryRequest request = new QueryRequest("*:*");
request.addField( new StoredField("title") ); 
// ... (Perform Search)

REST Example:

&fields=title

 

Special Fields

The StoredField expression can be used to retrieve the following special fields. 

The "*" Field

The "*" field can be used to request that all stored fields be returned for each document. This special field is useful when requesting all stored fields in addition to a more complex FieldExpression. Otherwise AIE would return only the one field in the results.

Example:

QueryRequest request = new QueryRequest("*:*");
request.addField( new StoredField("*") ); // equivalent to request.addField("*");
request.addField( new GeoDistance("position", 75.1, 78.2) );
// ... (Perform Search)

REST Example:

&fields=*

The ".id" Field

Document id's can be explicitly requested to be returned as field values by requesting the  FieldNames.ID   (.id) field.
This is especially useful when performing join queries in AGGREGATE mode as you will be returned a multi-value field containing the parent's document ID, as well as the document ID for all aggregated children.

QueryRequest request = new QueryRequest("*:*");
request.addField(FieldNames.ID); 
// ... (Perform Search)
  • No labels