Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Apache Solr Search Patterns

You're reading from  Apache Solr Search Patterns

Product type Book
Published in Apr 2015
Publisher
ISBN-13 9781783981847
Pages 316 pages
Edition 1st Edition
Languages
Author (1):
Jayant Kumar Jayant Kumar
Profile icon Jayant Kumar

Table of Contents (17) Chapters

Apache Solr Search Patterns
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Solr Indexing Internals Customizing the Solr Scoring Algorithm Solr Internals and Custom Queries Solr for Big Data Solr in E-commerce Solr for Spatial Search Using Solr in an Advertising System AJAX Solr SolrCloud Text Tagging with Lucene FST Index

Using Solr for text tagging


Now that we know what text tagging is and have seen some algorithms that can be used for text tagging, let us learn how text tagging is done using Solr. There is an open source library, Solr Text Tagger, that can be used for text tagging in Solr.

Note

The library can be referred to at the following link: https://github.com/OpenSextant/SolrTextTagger.

Text tagging via this library involves two layers of FSTs. A word dictionary FST is used to hold each unique word. This enables integers to be used as substitutes for a word (char[]). For example, the word New will be mapped to 13452 and another word Delhi will be mapped to 5223316:

New => 13452
Delhi => 5223316

The call to Lucene's FST library Util.getByOutput(<fst object>, 13452) will yield the word New.

The second layer is a word phrase FST comprising word ID string keys. In the case of New Delhi, the word phrase FST will be:

New Delhi => [13452, 5223316]

The tagging algorithm used in the Solr text tagger...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}