English 中文(简体)
我如何把使用db4o储存数据和Lucene作为快速检索数据的索引?
原标题:How do I combine usage of db4o to store data and Lucene to index data for fast search?

I m New to both db4o and Lucene.

目前,Im利用db4o维持我关于安套的数据。 我需要有能力进行快速搜查,并向用户提出建议(如汽车完整建议)。

一个SO海报提到使用Lucene作为数据索引,而db4o则用于储存。

是否有任何人采用这种办法? 如果是的话,我将不胜感激。 有哪些替代办法?

最佳回答

我利用Lucene从数据库中储存的物品中提取关键词,并储存我称之为关键词延伸物体,标明相应的领域物体。 这使得域标有关键词(也允许加以制止),并分离了关键词的关切。 数据库是从一个大型静态数据集(美元食品营养素数据库)建造的,因此,我没有必要担心在运行期间的变化。 因此,目前形式的这一解决办法是有限的。

解决办法的第一部分是将一部略微的法典编成一个地图,其中含有一些文字,并摘录。 您利用这一方法从你储存在数据库中的一些领域物体中提取关键词/项目。 我保留了最初的关键词,以便我能够就搜查工作得出某种统计数据。

第二部分是构造我称之为关键词的延伸,把 stem作为阵列和相应的关键词作为另一阵列加以储存,并对具有关键词的相应领域标有点(由于与非行4O合作比较容易)。 我还将我的关键词句缩略为与特定领域物体的类型相对应,例如,我正在储存一个Nutrient域标和相应的NutrientKeyword Extension标。

The third part is to collect the user s entered search text, again use the stemmer to extract the stems, and search for the NutrientKeywordExtension objects with those stems. You can then grab the Nutrient objects that those extensions point to, and finally present them as search results.

As I said, my database was static - it s created the first time the application runs. In a dynamic database, you would need to worry about keeping the nutrients and corresponding keyword extensions in sync. One solution would be to merge the nutrient and nutrient keyword extension into one class if you don t mind having that stuff inside your domain objects (I don t like this). Otherwise, you need to account for keyword extensions every time your create/edit/delete your domain objects.

I hope this limited example helps.

问题回答

暂无回答




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...