douping6871 2010-01-26 18:00
浏览 64
已采纳

我应该在Solr(或任何数据库)中索引或存储这些字段吗?

Background:
I have a cclassifieds website, and users may for example search for cars, and specify a price range, mileage, fueltype, gearbox and a manually inputted query-string if they like to put something specific into the search, ex "bmw m3".

Questions:
I am about to move this information to Solr for faster lookup, and wonder if I have to index or store the fields.

The only fields where users can search in is actually the "headline" and the "description" of the classified. They can however as I mention above, specify price ranges for example.

So I guess the "headline" and "description" fields should be indexed right? But should the price field, and any other sub-option fields also be indexed?

In a MySQL query the query-syntax would be something like this, so you can compare to what I am talking about: (may contain errors, forgot exactly how they where written)

  $query="SELECT * FROM cars_category WHERE headline='bmw m3' OR description='bmw m3' AND price BETWEEN 10000 AND 500000 AND fuel='petrol' AND etc etc";

So what do you think, index/store all fields or what?

Is there a method for determining what to store and what to index, or both?

Thanks

PS: Descriptive answers are appreciated

  • 写回答

3条回答 默认 最新

  • dongtong2021 2010-01-26 21:35
    关注

    and wonder if I have to index or store the fields.

    My understanding of Solr is very limited, but what confused me when I started was the indexing terminology: in a database, storing the data and creating/storing an index are two separate things and (generally speaking, at least) data is stored in two separate places, but in Solr, anything you upload to Solr is indexed. So you decide which fields you want Solr to be able to search, and you assign field types and - hey presto - Solr can find data in those field with impressive speed. You can determine how different fields are searched (case sensitive or not, for example) and you can determine range searches and the like: check out the wiki here http://wiki.apache.org/solr/FrontPage#Search_and_Indexing and the query syntax http://wiki.apache.org/solr/SolrQuerySyntax for comprehensive treatment of these.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行