static FieldType writeFieldName(String name, IndexSchema schema, Appendable out, int flags) throws IOException { FieldType ft = null; ft = schema.getFieldTypeNoEx(name); out.append(name); if (ft==null) { out.append("(UNKNOWN FIELD "+name+')'); } out.append(':'); return ft; }
File fstFile = new File(fstDirectory,fstFileName.toString()); FieldType fieldType = schema.getFieldTypeNoEx(fieldInfo.name); if(fieldType != null){ //if the fieldType is present
File fstFile = new File(fstDirectory,fstFileName.toString()); FieldType fieldType = schema.getFieldTypeNoEx(fieldInfo.name); if(fieldType != null){ //if the fieldType is present
&& schema.getFieldTypeNoEx(fieldTypeName) != null) { FieldType fieldType = schema.getFieldTypes() .get(fieldTypeName);
File fstFile = new File(fstDirectory,fstFileName.toString()); FieldType fieldType = schema.getFieldTypeNoEx(fieldInfo.name); if(fieldType != null){ //if the fieldType is present if(runtimeGeneration || fstFile.isFile()){ //and FST is present or can be created FieldInfo langStoreFieldInfo = fieldInfos.fieldInfo(encodedLangStoreField); if(langStoreFieldInfo != null){ FieldType fieldType = schema.getFieldTypeNoEx(langIndexFieldInfo.name); if(fieldType != null){
public SolrDocument getDoc(Document doc) { SolrDocument solrDoc = new SolrDocument(); for (Fieldable f : (List<Fieldable>) doc.getFields()) { String fieldName = f.name(); if (returnFields != null && !returnFields.contains(fieldName)) continue; FieldType ft = schema.getFieldTypeNoEx(fieldName); Object val; if (ft == null) { // handle fields not in the schema if (f.isBinary()) val = f.binaryValue(); else val = f.stringValue(); } else { try { if (useFieldObjects && KNOWN_TYPES.contains(ft.getClass())) { val = ft.toObject(f); } else { val = ft.toExternal(f); } } catch (Exception e) { // There is a chance of the underlying field not really matching the // actual field type . So ,it can throw exception LOG.warn("Error reading a field from document : " + solrDoc, e); //if it happens log it and continue continue; } } solrDoc.addField(fieldName, val); } return solrDoc; }
private void fillParams(ResponseBuilder rb, SolrParams params, String field) { this.field = field; this.ftype = rb.req.getSchema().getFieldTypeNoEx(this.field); this.offset = params.getFieldInt(field, FacetParams.FACET_OFFSET, 0); this.limit = params.getFieldInt(field, FacetParams.FACET_LIMIT, 100); Integer mincount = params.getFieldInt(field, FacetParams.FACET_MINCOUNT); if (mincount==null) { Boolean zeros = params.getFieldBool(field, FacetParams.FACET_ZEROS); // mincount = (zeros!=null && zeros) ? 0 : 1; mincount = (zeros!=null && !zeros) ? 1 : 0; // current default is to include zeros. } this.minCount = mincount; this.missing = params.getFieldBool(field, FacetParams.FACET_MISSING, false); // default to sorting by count if there is a limit. this.sort = params.getFieldParam(field, FacetParams.FACET_SORT, limit>0 ? FacetParams.FACET_SORT_COUNT : FacetParams.FACET_SORT_INDEX); if (this.sort.equals(FacetParams.FACET_SORT_COUNT_LEGACY)) { this.sort = FacetParams.FACET_SORT_COUNT; } else if (this.sort.equals(FacetParams.FACET_SORT_INDEX_LEGACY)) { this.sort = FacetParams.FACET_SORT_INDEX; } this.prefix = params.getFieldParam(field,FacetParams.FACET_PREFIX); } }
if (oldSchema.getFieldTypeNoEx(mapper.getTargetFieldname(entry)) != null) { return; // the field already exists in the schema
if (field != null && core.getSchema().getFieldTypeNoEx(field) != null) { analyzer = core.getSchema().getFieldType(field).getQueryAnalyzer();
FieldType ft = fieldname==null ? null : req.getSchema().getFieldTypeNoEx(fieldname);
for (int j = 0; j < fields.length; j++) { String field = StringHelper.intern(fields[j]); FieldType ft = raw ? null : rb.req.getSchema().getFieldTypeNoEx(field); if (ft==null) ft = new StrField();