English 中文(简体)
聚苯胺
原标题:Add field in solr schema.xml
  • 时间:2011-07-13 13:06:28
  •  标签:
  • solr
  • field

我正在利用索尔机对我的数据库进行搜索,并试图增加一个新领域(文章的出版),用于在我数据库查询后获得出版商的价值,即发现任何与该领域相当的外地名称。 因此,如何把它作为一个领域添加到该条的图象中,以便用该文章的检索价值(本人、头衔、日期和出版商)返还?

最佳回答

First of all: what kind of data is stored in publisher_id? If it is a number (int, log) so add an field with the corresponding type, like:

<field name="publisher_id" type="int" indexed="true" stored="true" />

在将一个领域纳入计划表X之后,你必须重新启动孤独状态,重建你的指数。

问题回答

请注意,Solr 4.4和Solr 5.0<

同时,如果你想在你的指数中增加一个领域,你有两个选择。 首先,你可以做以下努力: 将这个领域列入你的计划,明确你的指数,重新启用Solr和重新计算所有情况。 这往往难以维持。

Alternatively, you can use a dynamic field declaration. If you look in the schema, you ll see lines like these:

<dynamicField name="*_i"  type="int"    indexed="true"  stored="true"/>
<dynamicField name="*_is" type="int"    indexed="true"  stored="true"  multiValued="true"/>

这意味着,如果在<代码>_i或_is上添加一个名字的栏目,那么你就被打了。 这些情况通常在缺省表中得以实现,因此,如果你能够灵活地把实地称为外地,你都可以这样做。

If neither of those options look promising, your third option is to wait for Solr 4.4 or 5.0 and upgrade (which will also take a reindex in all likelihood!).





相关问题
solr problem to get the field names

Ive got a problem. In each document I ve got fields: threads.id and posts.id. I want to get the field name value for them so i can get data from the database. Between the lines beneath i have marked ...

Which is the better client for Solr + PHP?

I have two options http://www.php.net/manual/en/book.solr.php http://code.google.com/p/solr-php-client/ I read it somewhere that that 2) use JSON as output types whereas 1) use XML doc. Isn t ...

Geronimo vs Glassfish

For a production environment, is Apache Geronimo better for applications that uses ActiveMQ, Derby, Solr?

Sort by date in Solr/Lucene performance problems

We have set up an Solr index containing 36 million documents (~1K-2K each) and we try to query a maximum of 100 documents matching a single simple keyword. This works pretty fast as we had hoped for. ...

SOLR - delta import not with last_modified

I saw only ways using delta import with last_modified. Is there some other ways to do delta_imports withut using timestamps? For example, if i have unique key(integer), can i tell SOLR to index only ...

SOLR How to return only limited matched content

ok guys, say in my Schema I have 4 fields: <field name="SiteIdentifier" type="string" indexed="true" stored="true" required="true"/> <field name="Title" type="text" indexed="true" stored="...

Solr - character substitution

I have Solr with indexed database. In my database all data is in Latvian. The problem is, I need to be able to search word Riga as if it is word Rīga. Of course, i can define synonym - Rīga = Riga, ...

热门标签