KinoSearch::Docs::Tutorial::FieldType man page on Fedora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Fedora logo
[printable version]

KinoSearch::Docs::TutoUser:ContributedKinoSearch::Docs::Tutorial::FieldType(3)

NAME
       KinoSearch::Docs::Tutorial::FieldType - Specify per-field properties
       and behaviors.

DESCRIPTION
       The Schema we used in the last chapter specifies three fields:

	   my $type = KinoSearch::Plan::FullTextType->new(
	       analyzer => $polyanalyzer,
	   );
	   $schema->spec_field( name => 'title',   type => $type );
	   $schema->spec_field( name => 'content', type => $type );
	   $schema->spec_field( name => 'url',	   type => $type );

       Since they are all defined as "full text" fields, they are all
       searchable -- including the "url" field, a dubious choice.  Some URLs
       contain meaningful information, but these don't, really:

	   http://example.com/us_constitution/amend1.html

       We may as well not bother indexing the URL content.  To achieve that we
       need to assign the "url" field to a different FieldType.

   StringType
       Instead of FullTextType, we'll use a StringType, which doesn't use an
       Analyzer to break up text into individual fields.  Furthermore, we'll
       mark this StringType as unindexed, so that its content won't be
       searchable at all.

	   my $url_type = KinoSearch::Plan::StringType( indexed => 0 );
	   $schema->spec_field( name => 'url', type => $url_type );

       To observe the change in behavior, try searching for "us_constitution"
       both before and after changing the Schema and re-indexing.

   Toggling 'stored'
       For a taste of other FieldType possibilities, try turning off "stored"
       for one or more fields.

	   my $content_type = KinoSearch::Plan::FullTextType->new(
	       analyzer => $polyanalyzer,
	       stored	=> 0,
	   );

       Turning off "stored" for either "title" or "url" mangles our results
       page, but since we're not displaying "content", turning it off for
       "content" has no effect -- except on index size.

   Analyzers up next
       Analyzers play a crucial role in the behavior of FullTextType fields.
       In our next tutorial chapter, KinoSearch::Docs::Tutorial::Analysis,
       we'll see how changing up the Analyzer changes search results.

COPYRIGHT AND LICENSE
       Copyright 2008-2010 Marvin Humphrey

       This program is free software; you can redistribute it and/or modify it
       under the same terms as Perl itself.

perl v5.14.1			  2011KinoSearch::Docs::Tutorial::FieldType(3)
[top]

List of man pages available for Fedora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net