"So, there are 2 documents with results, but Solr show me fields without the word "alquileres", why?"
Because that's the way Solr is built <G>. It wouldn't be very useful for Solr to only return the fields with matches. Consider indexing articles with a title and contents. If you search matched on contents but not the title, would you really want the returned document from Solr to NOT have the title? You can control what fields are returned for the result set by specifying the "fl" parameter, either in the defaults for your config or on the URL if you only want specific fields back. And a general comment. It is highly unusual to have all those "string" fields. String fields are unanalyzed, meaning the entire field is a single term, no matter now many words are in it. This is rarely useful for anything except, say, part numbers or SKUs or IDs. For general text that you want to search on, this is almost never correct. You might want to spend some time on the admin/analysis page to get a better sense of this... Best Erick On Wed, Aug 24, 2011 at 9:35 AM, _snake_ <lucas.mig...@gmail.com> wrote: > Hi, > > I am using Apache Solr 3.2 and I want to know if it's possible to return > only the fields that have the term that I am searching. > > In the Solr Admin page, if I put the word "alquileres" and then I click the > button "Search", the following response is showed: > <response> > - > <lst name="responseHeader"> > <int name="status">0</int> > <int name="QTime">438</int> > </lst> > - > <result name="response" numFound="2" start="0"> > - > <doc> > - > <arr name="Accion"> > <str/> > <str/> > <str/> > <str/> > <str/> > <str/> > <str/> > <str/> > <str/> > </arr> > - > <arr name="Acciones"> > <str/> > <str/> > <str/> > <str/> > <str/> > <str/> > </arr> > - > <arr name="Actividad"> > <str/> > <str/> > <str/> > <str/> > <str/> > <str/> > <str/> > <str/> > </arr> > - > <arr name="Actividades"> > <str/> > <str/> > <str/> > </arr> > - > <arr name="Beneficiarios"> > <str/> > <str/> > <str/> > <str/> > </arr> > - > <arr name="Condicion"> > <str/> > <str/> > </arr> > - > <arr name="Creacion"> > <str/> > </arr> > - > <arr name="Cuantia"> > <str/> > <str/> > <str/> > </arr> > - > <arr name="Excepcion"> > ... > -------------------------------------------- > The HTTP Request is : > ...select/?q=alquileres&version=2.2&start=0&rows=10&indent=on > So, there are 2 documents with results, but Solr show me fields without the > word "alquileres", why? > My schema.xml file is: > <?xml version="1.0" ?> > <schema name="example core zero" version="1.1"> > <types> > <fieldtype name="string" class="solr.TextField" > positionIncrementGap="100"> > <analyzer type="index"> > <filter class="solr.StopFilterFactory" ignoreCase="true" > words="spanish_stop2.txt" enablePositionIncrements="true" /> > <tokenizer class="solr.WhitespaceTokenizerFactory"/> > <filter class="solr.WordDelimiterFilterFactory" > generateWordParts="1" generateNumberParts="1" catenateWords="1" > catenateNumbers="1" catenateAll="0" splitOnCaseChange="0"/> > <filter class="solr.LowerCaseFilterFactory"/> > </analyzer> > <analyzer type="query"> > <filter class="solr.StopFilterFactory" > ignoreCase="true" > words="spanish_stop2.txt" > enablePositionIncrements="true" > /> > <tokenizer class="solr.WhitespaceTokenizerFactory"/> > <filter class="solr.WordDelimiterFilterFactory" > generateWordParts="1" generateNumberParts="1" catenateWords="0" > catenateNumbers="0" catenateAll="0" splitOnCaseChange="0"/> > <filter class="solr.LowerCaseFilterFactory"/> > </analyzer> > </fieldtype> > > <fieldtype name="string2" class="solr.TextField" > positionIncrementGap="100" autoGeneratePhraseQueries="true"> > <analyzer type="index"> > <tokenizer class="solr.WhitespaceTokenizerFactory"/> > </analyzer> > <analyzer type="query"> > <tokenizer class="solr.WhitespaceTokenizerFactory"/> > </analyzer> > </fieldtype> > </types> > > <fields> > > <field name="RutaFichero" type="string2" indexed="true" > stored="true" multiValued="false" required="true"/> > > <field name="TitlePV" type="string" indexed="true" stored="true" > multiValued="true" termVectors="true" termPositions="true" > termOffsets="true" /> > > <field name="TextPV" type="string" indexed="true" stored="true" > multiValued="true" termVectors="true" termPositions="true" > termOffsets="true" /> > > <field name="TitlePart" type="string" indexed="true" stored="true" > multiValued="true" termVectors="true" termPositions="true" > termOffsets="true" /> > > <field name="TextPart" type="string" indexed="true" stored="true" > multiValued="true" termVectors="true" termPositions="true" > termOffsets="true" /> > > <field name="TextSubPart" type="string" indexed="true" stored="true" > multiValued="true" termVectors="true" termPositions="true" > termOffsets="true" /> > > <field name="Accion" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Actividad" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Objeto" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Objetivo" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="LineasDe" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Linea" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Concepto" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="TiposDeAyuda" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Destino" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Acciones" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Actividades" type="string" indexed="true" stored="true" > multiValued="true"/> > > <field name="Finalidad" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Caracteristicas" type="string" indexed="true" > stored="true" multiValued="true" /> > > <field name="Beneficiarios" type="string" indexed="true" > stored="true" multiValued="true" /> > > <field name="Cuantia" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Plazo" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Excepcion" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Obligaciones" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Condicion" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Ambito" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Subvencionables" type="string" indexed="true" > stored="true" multiValued="true" /> > > <field name="Error" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Corrige" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Modifica" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Apoyos" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Apoyable" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Compromisos" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Incentivable" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Definicion" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Protegibles" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Creacion" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Presentacion" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Disposicion" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="Tramite" type="string" indexed="true" stored="true" > multiValued="true" /> > > <field name="todas" type="string" indexed="true" stored="true" > multiValued="true" /> > > <dynamicField name="TitlePV_*" type="string" multiValued="true" > indexed="true" stored="true" /> > <dynamicField name="TextPV_*" type="string" multiValued="true" > indexed="true" stored="true" /> > <dynamicField name="TitlePart_*" type="string" multiValued="true" > indexed="true" stored="true" /> > <dynamicField name="TextPart_*" type="string" multiValued="true" > indexed="true" stored="true" /> > <dynamicField name="TextSubPart_*" type="string" multiValued="true" > indexed="true" stored="true" /> > > <copyField source="*" dest="todas"/> > > > > </fields> > > > <uniqueKey>RutaFichero</uniqueKey> > > > > <defaultSearchField>todas</defaultSearchField> > > <solrQueryParser defaultOperator="OR"/> > </schema> > ---------------------------------------- > > Thanks! > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Return-only-the-fields-where-there-are-results-tp3280978p3280978.html > Sent from the Solr - User mailing list archive at Nabble.com. >