java - How to determine field-type for SOLR indexing? -
I have a table in MySQL table with a VARCHAR and a "title" for the classified (classified website). Second, there is a text field with "text" for classified.
Two questions:
How should I decide how to index these two areas? (which field-type, which class to use etc)
Currently I have "ad_id" as a unique identifier for each ad, for example "BMW_M 3_82398292"
Whenever a 'query match' is found by SOLR, how can I return SOLR to this identifier? (The first part of the identifier is actually the contents of the heading area, the second part is a random number
thanks
1 schema
Your solar schema is much more specific than your desired search behavior in your schema.xml file, you will see" text "and A bunch of options like "string" will appear. They behave differently.
in a SQL statement. >
== field type name = "text_way" class = "solar.testfield" increase in positionGeep = "100">
gt; linking class = "solver.WhitespaceTokenizerFactory "/> gt; & lt; / fieldtype & gt; text_how field type tokens however, in the
text
area One big stop stop-word Issues and delimiter and filter for lower-casing. Note that these filters have been designated for both the Lucine Index and Solar Query. So when searching for a text field, it will optimize the query term using these filters to help find the match.& lt; Fieldtype name = "text" class = "solr.TextField" positionIncrementGap = "100" & gt; & Lt; Analyzer Type = "Index" & gt; & Lt; Tokenizer class = "solr.WhitespaceTokenizerFactory" /> & Lt; Ignore filter class = "solr.StopFilterFactory" = "true" word = "stopwords.txt" /> & Lt; Filter ..... /> & Lt; Filter ..... /> & Lt; Filter ..... /> & Lt; / Analyzer & gt; & Lt; / Fieldtype & gt;
For example, when indexing things like news, you probably want to search company names and headlines differently.
& lt; Field name = "headline" type = "article" /> & Lt; Field name = "coname" type = "string" index = "true" multidimensional = "false" omitNorms = "true" />
The above examples give you the
& amp; Coname: Intel & amp; Title: Processor + specifications
allows to do a search like that and exactly achieves matching matches to kill Intel's stories.
If you want to search for a category
2 result fields
you
& Lt; RequestHandler can set a standard set of return fields in name = "mumble" class = "solr.DisMaxRequestHandler" & gt; ; & Lt; Str name = "fl" & gt; Category, coname, headline & lt; / Str & gt; & Lt; / RequestHandler & gt;
You can also define the desired field by using the
fl
parameter in your query string./ select? Indent = ON & amp; Version = 2.2 & amp; Q = coname% 3AIn * & amp; Start = 0 & amp; Rows = 10 & amp; Amp = coname% 2Cid & amp; Qt = standard
You can also do this in your query
field: [x to *]
using the syntax. If you want to select some ads from your date, you can create a query in your query terms withad_date: [20100101 TO 20100201]
You can. (There are several ways to search for categories, I am presenting a method that uses an integer rather than a date range.)
Comments
Post a Comment