Simplify schema, with only 4 fields: id, text, *_facet, and *_text. The client does not send text, only *_text, which gets copied into the text field. This is surely overly simplified, and will evolve back as field name munging facilities are added and other data types are supported.

git-svn-id: https://svn.apache.org/repos/asf/incubator/solr/trunk@496204 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Erik Hatcher 2007-01-15 01:49:54 +00:00
parent f06086ede6
commit e343ccc2ab
4 changed files with 9 additions and 39 deletions

View File

@ -210,14 +210,8 @@
EXAMPLE: name="*_i" will match any field ending in _i (like myid_i, z_i)
Longer patterns will be matched first. if equal size patterns
both match, the first appearing in the schema will be used. -->
<dynamicField name="*_i" type="sint" indexed="true" stored="true"/>
<dynamicField name="*_s" type="string" indexed="true" stored="true"/>
<dynamicField name="*_l" type="slong" indexed="true" stored="true"/>
<dynamicField name="*_t" type="text" indexed="true" stored="true"/>
<dynamicField name="*_b" type="boolean" indexed="true" stored="true"/>
<dynamicField name="*_f" type="sfloat" indexed="true" stored="true"/>
<dynamicField name="*_d" type="sdouble" indexed="true" stored="true"/>
<dynamicField name="*_dt" type="date" indexed="true" stored="true"/>
<dynamicField name="*_facet" type="string" indexed="true" stored="true"/>
<dynamicField name="*_text" type="text" indexed="true" stored="true"/>
</fields>
<!-- field to use to determine and enforce document uniqueness. -->
@ -232,16 +226,7 @@
<!-- copyField commands copy one field to another at the time a document
is added to the index. It's used either to index the same field differently,
or to add multiple fields to the same field for easier/faster searching. -->
<!-- <copyField source="id" dest="sku"/>
<copyField source="cat" dest="text"/>
<copyField source="name" dest="text"/>
<copyField source="manu" dest="text"/>
<copyField source="features" dest="text"/>
<copyField source="includes" dest="text"/>
<copyField source="manu" dest="manu_exact"/>
-->
<copyField source="*_text" dest="text"/>
<!-- Similarity is the scoring routine for each document vs. a query.
A custom similarity may be specified here, but the default is fine

View File

@ -267,7 +267,7 @@
&amp; separated key=val pairs ... but there shouldn't be any
URL escaping of the values -->
<pingQuery>
qt=dismax&amp;q=solr&amp;start=3&amp;fq=id:[* TO *]&amp;fq=cat:[* TO *]
q=solr
</pingQuery>
<!-- configure a healthcheck file for servers behind a loadbalancer
<healthcheck type="file">server-enabled</healthcheck>

View File

@ -210,14 +210,8 @@
EXAMPLE: name="*_i" will match any field ending in _i (like myid_i, z_i)
Longer patterns will be matched first. if equal size patterns
both match, the first appearing in the schema will be used. -->
<dynamicField name="*_i" type="sint" indexed="true" stored="true"/>
<dynamicField name="*_s" type="string" indexed="true" stored="true"/>
<dynamicField name="*_l" type="slong" indexed="true" stored="true"/>
<dynamicField name="*_t" type="text" indexed="true" stored="true"/>
<dynamicField name="*_b" type="boolean" indexed="true" stored="true"/>
<dynamicField name="*_f" type="sfloat" indexed="true" stored="true"/>
<dynamicField name="*_d" type="sdouble" indexed="true" stored="true"/>
<dynamicField name="*_dt" type="date" indexed="true" stored="true"/>
<dynamicField name="*_facet" type="string" indexed="true" stored="true"/>
<dynamicField name="*_text" type="text" indexed="true" stored="true"/>
</fields>
<!-- field to use to determine and enforce document uniqueness. -->
@ -232,16 +226,7 @@
<!-- copyField commands copy one field to another at the time a document
is added to the index. It's used either to index the same field differently,
or to add multiple fields to the same field for easier/faster searching. -->
<!-- <copyField source="id" dest="sku"/>
<copyField source="cat" dest="text"/>
<copyField source="name" dest="text"/>
<copyField source="manu" dest="text"/>
<copyField source="features" dest="text"/>
<copyField source="includes" dest="text"/>
<copyField source="manu" dest="manu_exact"/>
-->
<copyField source="*_text" dest="text"/>
<!-- Similarity is the scoring routine for each document vs. a query.
A custom similarity may be specified here, but the default is fine

View File

@ -58,11 +58,11 @@ class ServerTest < Test::Unit::TestCase
end
def test_escaping
doc = Solr::Document.new :id => 47, :ruby_t => 'puts "ouch!"'
doc = Solr::Document.new :id => 47, :ruby_text => 'puts "ouch!"'
@connection.send(Solr::Request::AddDocument.new(doc))
@connection.commit
request = Solr::Request::Standard.new :query => 'ruby_t:ouch'
request = Solr::Request::Standard.new :query => 'ouch'
result = @connection.send(request)
assert_match /puts/, result.raw_response