protected Field.Index getFieldIndex(SchemaField field, String internalVal) { return field.indexed() ? (isTokenized() ? Field.Index.TOKENIZED : Field.Index.UN_TOKENIZED) : Field.Index.NO; }
private SchemaField getIndexedField(String fname) { SchemaField f = getFields().get(fname); if (f==null) { throw new RuntimeException("unknown field '" + fname + "'"); } if (!f.indexed()) { throw new RuntimeException("'"+fname+"' is not an indexed field:" + f); } return f; }
throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "can not sort on undefined field: "+part, e ); if (f == null || !f.indexed()){ throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "can not sort on unindexed field: "+part );
/** * @return a string representing a SchemaField's flags. */ private static String getFieldFlags( SchemaField f ) { FieldType t = (f==null) ? null : f.getType(); // see: http://www.nabble.com/schema-field-properties-tf3437753.html#a9585549 boolean lazy = false; // "lazy" is purely a property of reading fields boolean binary = false; // Currently not possible StringBuilder flags = new StringBuilder(); flags.append( (f != null && f.indexed()) ? FieldFlag.INDEXED.getAbbreviation() : '-' ); flags.append( (t != null && t.isTokenized()) ? FieldFlag.TOKENIZED.getAbbreviation() : '-' ); flags.append( (f != null && f.stored()) ? FieldFlag.STORED.getAbbreviation() : '-' ); flags.append( (f != null && f.multiValued()) ? FieldFlag.MULTI_VALUED.getAbbreviation() : '-' ); flags.append( (f != null && f.storeTermVector() ) ? FieldFlag.TERM_VECTOR_STORED.getAbbreviation() : '-' ); flags.append( (f != null && f.storeTermOffsets() ) ? FieldFlag.TERM_VECTOR_OFFSET.getAbbreviation() : '-' ); flags.append( (f != null && f.storeTermPositions() ) ? FieldFlag.TERM_VECTOR_POSITION.getAbbreviation() : '-' ); flags.append( (f != null && f.omitNorms()) ? FieldFlag.OMIT_NORMS.getAbbreviation() : '-' ); flags.append( (f != null && f.omitTf()) ? FieldFlag.OMIT_TF.getAbbreviation() : '-' ); flags.append( (lazy) ? FieldFlag.LAZY.getAbbreviation() : '-' ); flags.append( (binary) ? FieldFlag.BINARY.getAbbreviation() : '-' ); flags.append( (f != null && f.isCompressed()) ? FieldFlag.COMPRESSED.getAbbreviation() : '-' ); flags.append( (f != null && f.sortMissingFirst() ) ? FieldFlag.SORT_MISSING_FIRST.getAbbreviation() : '-' ); flags.append( (f != null && f.sortMissingLast() ) ? FieldFlag.SORT_MISSING_LAST.getAbbreviation() : '-' ); return flags.toString(); }
if ((defaultSearchField == null) || !defaultSearchField.indexed()) { String msg = "default search field '" + defaultSearchFieldName + "' not defined or not indexed" ; throw new SolrException( SolrException.ErrorCode.SERVER_ERROR, msg );
.getType().getTypeName()); fieldBuilder.allAttributes.put("indexed", Boolean .toString(schemaField.indexed())); fieldBuilder.allAttributes.put("stored", Boolean .toString(schemaField.stored()));
@Override public Field createField(SchemaField field, String externalVal, float boost) { boolean indexed = field.indexed(); boolean stored = field.stored(); if (!indexed && !stored) { if (log.isTraceEnabled()) log.trace("Ignoring unindexed/unstored field: " + field); return null; } int ps = precisionStep; byte[] arr=null; TokenStream ts=null; long time = super.parseMath(null, externalVal).getTime(); if (stored) arr = TrieField.toArr(time); if (indexed) ts = new NumericTokenStream(ps).setLongValue(time); Field f; if (stored) { f = new Field(field.getName(), arr, Field.Store.YES); if (indexed) f.setTokenStream(ts); } else { f = new Field(field.getName(), ts); } // term vectors aren't supported f.setOmitNorms(field.omitNorms()); f.setOmitTermFreqAndPositions(field.omitTf()); f.setBoost(boost); return f; }
if (field.indexed()) { type.setIndexed(true); type.setTokenized(true);
if (!field.indexed() && !field.stored()) { if (log.isTraceEnabled()) log.trace("Ignoring unindexed/unstored field: " + field);
@Override public Field createField(SchemaField field, String externalVal, float boost) { boolean indexed = field.indexed(); boolean stored = field.stored();
if (!field.indexed()) { continue;
if( ttinfo != null && sfield != null && sfield.indexed() ) { Query q = new ConstantScoreRangeQuery(fieldName,null,null,false,false); TopDocs top = searcher.search( q, 1 );
@Override public IndexableField createField(final SchemaField field, final Object value, final float boost) { if (!field.indexed()) { throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "SirenField instances must be indexed: " +
@Override public IndexableField createField(final SchemaField field, final Object value, final float boost) { if (!field.indexed()) { throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "ExtendedJsonField instances must be indexed: " +