- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个数据库,我想与 Zend_Search_Lucene
一起使用.但是,我很难为 Lucene 创建一个“完全可搜索”的文档。
每个Zend_Search_Lucene
文档从两个关系数据库表( Table_One
和 Table_Two
)中提取信息。 Table_One
有基本信息( id
、 owner_id
、 title
、 description
、 location
等)、Table_Two
与 Table_One
有 1:N 的关系(意思是,对于 Table_One
中的每个条目, Table_Two
中可能有一个或多个条目)。 Table_Two 包含:id,listing_id
, bedrooms
, bathrooms
, price_min
, price_max
, date_available
.参见图 1。
图1
Table_One
id (Primary Key)
owner_id
title
description
location
etc...
Table_Two
id (Primary Key)
listing_id (Foreign Key to Table_One)
bedrooms (int)
bathrooms (int)
price_min (int)
price_max (int)
date_available (datetime)
Table_Two
每个条目
Table_One
入口。 【问题1】如何创建
Zend_Search_Lucene
每个字段都是唯一的文档? (见图2)
Lucene Document
id:Keyword
owner_id:Keyword
title:UnStored
description:UnStored
location: UnStored
date_registered:Keyword
... (other Table_One information)
bedrooms: UnStored
bathrooms: UnStored
price_min: UnStored
price_max: UnStored
date_available: Keyword
bedrooms_1: <- Would prefer not to have do this as this makes the bedrooms harder to search.
bedrooms
进行范围查询,
bathrooms
,
price_min
和
price_max
领域。 (例如:查找包含 1 到 3 间卧室的文档)
Zend_Search_Lucene
将只允许在同一字段上进行范围搜索。根据我的理解,这意味着我想要进行范围查询的每个字段只能包含一个值(例如:卧室:“1 卧室”);
bedrooms
,
bathrooms
,
price_min
,
price_max
,
date_available
以空格分隔的字段。
Sample Table_One Entry:
| 5 | 2 | "Sample Title" | "Sample Description" | "Sample Location" | 2008-01-12
Sample Table_Two Entries:
| 10 | 5 | 3 | 1 | 900 | 1000 | 2009-10-01
| 11 | 5 | 2 | 1 | 800 | 850 | 2009-08-11
| 12 | 5 | 1 | 1 | 650 | 650 | 2009-09-15
id:5
owner_id:2
title: "Sample Title"
description: "Sample Description"
location: "Sample Location"
date_registered: [datetime stamp YYYY-MM-DD]
bedrooms: "3 bedroom 2 bedroom 1 bedroom"
bathrooms: "1 bathroom 1 bathroom 1 bathroom"
price_min: "900 800 650"
price_max: "1000 850 650"
date_available: "2009-10-01 2009-08-11 2009-09-15"
bedroom
上做范围查询搜索吗? ,
bathroom
,
price_min
,
price_max
,
date_available
上面显示的字段还是每个范围查询字段必须只包含一个值(例如“1 间卧室”)?我无法让范围查询以其当前形式工作。我在这里不知所措。
最佳答案
bedrooms: 3
price_min: 900
date_available:[20100101 TO 20100301] AND price_min:[600 TO 1000]
关于zend-framework - Zend 搜索 lucene,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1053039/
嗨,我有一个包含此代码的 Zend 表单 $field = new Zend_Form_Element_Submit('submit'); $field->setAttrib('class', 'bt
我现在正在尝试使用 zend expressive 并研究如何处理数据库。我在看this ,但不清楚。我使用 composer 安装 zend-db,它提到在 dependencies.global.
我已经通过 Zend auth 创建了一个登录系统,这里是代码 // userAuthentication public function authAction(){ $reque
好的,所以我对 Zend 比较陌生。我已经创建了一个新的应用程序并开始构建基于 a guide 的身份验证系统.但是,服务器正在踢出一个内部服务器错误。 检查 PHP 错误日志后,我得到以下两个错误:
编辑:: 问题是由 Zend 路由引起的,请检查更新 我正在使用 xml 文件进行导航。 编辑::以下代码来自layout.phtml文件 $config = new Zend_Config_Xml(
我想将变量从 Controller 传递到表单。如何实现?谁能帮我解决这个问题。 谢谢。 最佳答案 只是一个活生生的例子: class Admin_Form_Product extends Admin
就目前情况而言,这个问题不太适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、民意调查或扩展讨论。如果您觉得这个问题可以改进并可能重新开放,visit
我使用默认 Zend_Rest_Route 来生成 Rest 路由: 所以鉴于我只是把 resources.router.routes.rest.type = Zend_Rest_Route在 app
是否存在类似于 Zend Validator Identical 的 Zend Filter? 我应该过滤 input=='test' 的情况 $el->addFilter('Identical','
在/application 文件夹中创建了几个文件夹(例如表单和模型),然后开始向这些文件夹添加类之后,如何使这些类的代码自动完成在我的各种其他文件(例如我的文件)中可用IndexController
我正在尝试删除隐藏表单元素上的默认装饰器。默认情况下,隐藏元素显示如下: Hidden Element Label (if I had set one) 我不希望隐藏元素占用页面上的空间。我想删除所
我是框架新手,但我在安装 zend 1.x 版本等方面没有任何困难。但是ZF2真的搞不懂......任何资源告诉我使用 zend 工具创建项目,即 bin 目录中的 zf.bat 或 zf.sh,但与
我想使用装饰器将下面的 Zend_Form 格式化为表格,在第一列中放置描述并 Zend_Form_Element_Radio 的选项在第二列中和 在每一行中添加 2 个选择,您可以在稍后的 html
当您查看 在下面的标记中,您会看到有一个带有 id 地址标签的 dt 和以下 dd,我想删除这些但保留 字段集。 要添加显示组,我在其中使用了这个 $this->addDisplayGroup(arr
我已经阅读了所有关于路由和 Zend 文档的帖子,但我仍然无法解决这个问题。 我有一个包含两个模块的多语言应用程序:default 和 admin。语言选择工作正常(在 Controller rout
/* Form Elements & Other Definitions Here ... */ $this->setAction("auth") ->setMethod("post")
我正在按照官方教程在 Zend 服务器上部署示例 Zend 应用程序。无论我部署什么,我唯一可以访问的是 hello world 页面(Hello world 打招呼)。 如何访问真实应用程序? ho
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 3年前关闭。 Improve thi
在 Zend 中使用命名空间的最佳实践是什么? 如何管理存储库、服务等的命名空间? 我在 Zend 文档 here 中找到了一个通用的目录结构,但它没有描述在哪里放置存储库和其他服务! 请将其视为 M
我有问题,以下 Zend 表单会引发错误。 问题是"file"元素和使用 setElementDecorators。 class Products_AddForm extends Zend_F
我是一名优秀的程序员,十分优秀!