您好,欢迎光临本网站![请登录][注册会员]  
文件名称: Hibernate Search in Sction
  所属分类: Java
  开发工具:
  文件大小: 8mb
  下载次数: 0
  上传时间: 2013-03-25
  提 供 者: queb*****
 详细说明: 1 State of the art 3 1.1 What is search? 4 Categorizing information 5 ■ Using a detailed search screen 5 Using a user-friendly search box 7 ■ Mixing search strategies 7 Choosing a strategy: the first step on a long road 8 1.2 Pitfalls of search engines in relational databases 8 Query information spread across several tables 9 ■ Searching words, not columns 9 ■ Filtering the noise 9 ■ Find by words...fast 10 ■ Searching words with the same root and meaning 11 ■ Recovering from typos 11 ■ Relevance 11 Many problems. Any solutions? 12 1.3 Full-text search: a promising solution 12 Indexing 13 ■ Searching 15 ■ Full-text search solutions 171.4 Mismatches between the round object world and the flat text world 22 The structural mismatch 23 ■ The synchronization mismatch 24 ■ The retrieval mismatch 25 1.5 Summary 26 2 Getting started with Hibernate Search 28 2.1 Requirements: what Hibernate Search needs 30 2.2 Setting up Hibernate Search 31 Adding libraries to the classpath 31 ■ Providing configuration 34 2.3 Mapping the domain model 38 Indexing an entity 38 ■ Indexing properties 39 What if I don’t use Hibernate Annotations? 41 2.4 Indexing your data 42 2.5 Querying your data 43 Building the Lucene query 44 ■ Building the Hibernate Search query 46 ■ Executing a Hibernate Search query 47 2.6 Luke: inside look into Lucene indexes 48 2.7 Summary 59 PART 2 ENDING STRUCTURAL AND SYNCHRONIZATION MISMATCHES..................... 61 3 Mapping simple data structures 63 3.1 Why do we need mapping, again? 64 Converting the structure 65 ■ Converting types 66 Defining the indexing strategy 67 3.2 Mapping entities 67 Marking an entity as indexed 67 ■ Subclasses 69 Mapping the primary key 71 ■ Understanding the index structure 73 3.3 Mapping properties 75 Marking a property as indexed 75 ■ Built-in bridges 76 Choosing an indexing strategy 78 ■ Indexing the same property multiple times 82 CONTENTS ix 3.4 Refining the mapping 83 Analyzers 83 ■ Boost factors 85 3.5 Summary 87 4 Mapping more advanced data structures 88 4.1 Mapping the unexpected: custom bridges 89 Using a custom bridge 91 ■ Writing simple custom bridges 93 Injecting parameters to bridges 97 ■ Writing flexible custom bridges 99 4.2 Mapping relationships between entities 104 Querying on associations and full-text searching 104 Indexing embedded objects 107 ■ Indexing associated objects 110 4.3 Summary 114 5 Indexing: where, how, what, and when 115 5.1 DirectoryProvider: storing the index 117 Defining a directory provider for an entity 117 ■ Using a filesystem directory provider 118 ■ Using an in-memory directory provider 119 ■ Directory providers and clusters 120 ■ Writing you own directory provider 124 5.2 Analyzers: doors to flexibility 125 What’s the job of an analyzer? 125 ■ Must-have analyzers 128 ■ Indexing to cope with approximative search 130 ■ Searching by phonetic approximation 131 Searching by synonyms 133 ■ Searching by words from the same root 134 ■ Choosing a technique 139 5.3 Transparent indexing 139 Capturing which data has changed 140 ■ Indexing the changed data 141 ■ Choosing the right backend 144 Extension points: beyond the proposed architectures 148 5.4 Indexing: when transparency is not enough 151 Manual indexing APIs 151 ■ Initially indexing a data set 153 ■ Disabling transparent indexing: taking control 156 5.5 Summary 158 x CONTENTS PART 3 TAMING THE RETRIEVAL MISMATCH............... 159 6 Querying with Hibernate Search 161 6.1 Understanding the query paradigm 162 The burdens of using Lucene by hand 162 ■ Query mimicry 163 Getting domain objects from a Lucene query 164 6.2 Building a Hibernate Search query 166 Building a FullTextSession or a FullTextEntityManager 166 Creating a FullTextQuery 168 ■ Limiting the types of matching entities 171 6.3 Executing the full-text query 175 Returning a list of results 176 ■ Returning an iterator on the results 177 ■ Returning a scrollable result set 178 ■ Returning a single result 181 6.4 Paginating through results and finding the total 183 Using pagination 184 ■ Retrieving the total number of results 186 ■ Multistage search engine 187 6.5 Projection properties and metadata 188 6.6 Manipulating the result structure 191 6.7 Sorting results 194 6.8 Overriding fetching strategy 196 6.9 Understanding query results 198 6.10 Summary 199 7 Writing a Lucene query 201 7.1 Understanding Lucene’s query syntax 202 Boolean queries—this and that but not those 203 ■ Wildcard queries 206 ■ Phrase queries 207 ■ Fuzzy queries—similar terms (even misspellings) 208 ■ Range queries—from x TO y 209 ■ Giving preference with boost 210 ■ Grouping queries with parentheses 211 ■ Getting to know the standard QueryParser and ad hoc queries 212 7.2 Tokenization and fields 214 Fields/properties 214 ■ Tokenization 215 ■ Analyzers and their impact on queries 216 ■ Using analyzers during indexing 216 ■ Manually applying an analyzer to a query 219 Using multiple analyzers in the same query 221 CONTENTS xi 7.3 Building custom queries programmatically 224 Using Query.toString() 224 ■ Searching a single field for a single term: TermQuery 225 ■ MultiFieldQueryParser queries more than one field 228 ■ Searching words by proximity: PhraseQuery 231 ■ Searching for more: WildcardQuery, PrefixQuery 234 ■ When we’re not sure: FuzzyQuery 237 ■ Searching in between: RangeQuery 240 A little of everything: BooleanQuery 244 ■ Using the boost APIs 247 7.4 Summary 249 8 Filters: cross-cutting restrictions 251 8.1 Defining and using a filter 252 Lucene filter 253 ■ Declaring a filter in Hibernate Search 255 ■ Applying filters to a query 259 8.2 Examples of filter usage and their implementation 261 Applying security 261 ■ Restricting results to a given range 264 ■ Searching within search results 267 ■ Filter results based on external data 269 8.3 Summary 271 PART 4 PERFORMANCE AND SCALABILITY................... 273 9 Performance considerations 275 9.1 Optimizing indexing 276 What influences indexing time for a single entity 276 Optimizing many concurrent indexing operations 277 ■ Optimizing mass indexing 279 9.2 Optimizing searches 282 Optimizing the way you write queries 282 Maximizing benefits from the caching mechanisms 286 9.3 Optimizing the index structure 288 Running an optimization 289 ■ Tuning index structures and operations 292 9.4 Sharding your indexes 294 Configuring sharding 296 ■ Choosing how to shard your data 297 xii CONTENTS 9.5 Testing your Hibernate Search application 303 Mocking Hibernate Search 303 ■ Testing with an in-memory index and database 305 ■ Performance testing 308 Testing users 308 9.6 Summary 309 10 Scalability: using Hibernate Search in a cluster 310 10.1 Exploring clustering approaches 311 Synchronous clustering 311 ■ Asynchronous clustering 314 10.2 Configuring slave nodes 318 Preparing the backend 319 ■ Preparing the directory providers 321 10.3 Configuring the master node 322 Building the message consumer 322 ■ Preparing the master queue 324 ■ Preparing the directory providers 325 10.4 Summary 326 11 Accessing Lucene natively 327 11.1 Getting to the bottom of Hibernate Search 328 Accessing a Lucene directory 328 ■ Obtaining DirectoryProviders from a non-sharded entity 330 ■ And now for sharding one entity into two shards 332 ■ Indexing two non-sharded entities 335 Shoehorning multiple entities into one index (merging) 337 11.2 Obtaining and using a Lucene IndexReader within the framework 342 11.3 Writing a DirectoryProvider your way 343 11.4 Projecting your will on indexes 347 11.5 Summary 350 PART 5 NATIVE LUCENE, SCORING, AND THE WHEEL ........................................... 351 12 Document ranking 353 12.1 Scoring documents 354 Introducing the vector space model 354 ■ Normalizing document length to level the playing field 359 ■ Minimizing large term count effects 361 CONTENTS xiii 12.2 Exploring Lucene’s scoring approach and the DefaultSimilarity class 364 DefaultSimilarity examples 366 ■ Query boosting 375 12.3 Scoring things my way 378 Modifying a query’s Weight class 380 ■ Revisiting the Scorer class 384 ■ Is it worth it? 385 12.4 Document relevance 386 Understanding Precision vs. Recall 386 ■ Measuring a system’s relevance accurately 387 ■ Document feedback: tell me what you want! 388 ■ Improving relevance with MoreLikeThis 393 12.5 Summary 398 13 Don’t reinvent the wheel 399 13.1 Playing in the Sandbox 400 Making results stand out with the term Highlighter class 400 Modifying a score the easy way with BoostingQuery 404 ■ But I was querying for “flick” utilizing a synonym search 409 Implementing regular expression searches and querying for “sa.[aeiou]s.*” 412 ■ Utilizing a spellchecker 415 13.2 Making use of third-party contributions 418 Utilizing PDFBox to index PDF documents 418 ■ Indexing Microsoft Word files with POI 425 ■ Indexing a simple text file 427 13.3 Processing XML 429 Parsing with SAX 430 ■ Parsing with the DOM 434 Pros and cons of the different methods 438 13.4 Summary 440 appendix Quick reference 441 index 451 ...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索: Hibernate JavaSSH Java EE
 输入关键字,在本站1000多万海量源码库中尽情搜索: