import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
+/**
+ * indexes whether an Enity has audio
+ */
public class AudioSearchTerm extends SearchTerm{
public AudioSearchTerm() {
super(null, "search_hasAudio", "hasAudio", null, "hasAudio");
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
-
+/**
+ * Tokenizes a string field in an Entity and indexes
+ * it, but does not store it for retrieval (used for content_data)
+ */
public class ContentSearchTerm extends SearchTerm{
protected ContentSearchTerm() {
}
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
-
+/**
+ * Indexes whether or not an Entity has associated
+ * images, and also stores urls of those images for
+ * retrieval in the search results
+ */
public class ImagesSearchTerm extends SearchTerm{
public ImagesSearchTerm() {
super (null, "search_hasImages", "hasImages", "images", "images");
import org.apache.lucene.document.Field;
-
+/**
+ * indexes a field and stores it for retrieval, but
+ * does not tokenize it. useful for things
+ * like strings representing
+ */
public class KeywordSearchTerm extends SearchTerm{
import org.apache.lucene.document.Document;
-
+/**
+ * not used
+ */
public class MediaSearchTerm extends SearchTerm{
public MediaSearchTerm() {
super(null, "search_hasMedia", "", null, "");
import org.apache.lucene.document.Document;
+/**
+ * The SearchTerm class attempts to encapsulate the relationships
+ * between:
+ * <ul>
+ * <li>A fields or property of Content Entities</li>
+ * <li>A field of Lucene Documents</li>
+ * <li>An HTTP Query Parameter</li>
+ * <li>And a bit of HTML on a Search Results Page</li>
+ * </ul>
+ * The basic idea is that how you index, query, and display a
+ * particular field in a resource are all intimately related, possibly
+ * more so than how you index two different fields of the same
+ * resource.
+ *
+ * <p>Instances of classes implementing SearchTerm are created when a Mir
+ * content entity is indexed by the IndexingProducerNode Class. The
+ * index method of each class is called in turn to add a bit of
+ * information to the Lucene documents which will be added to the
+ * index after it is created and all its fields specified. Instances
+ * of the same classes are created by ServletModuleOpenIndy so that it
+ * can construct a query to match against the lucene index, here the
+ * makeTerm methods are called in turn to pick out the parameter they
+ * want from the request and then construct the appropriate fragment
+ * of lucene query, which are ultimately concatenated together. These
+ * classes are also used to return appropriate template models
+ * representing any hits to be displayed as a result of processing the
+ * query.</p>
+ */
abstract public class SearchTerm {
protected String partOfEntity;
protected String paramName;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
-
+/**
+ * tokenizes a string field in an Entity and indexes
+ * it, and stores it for retrieval (used for description)
+ */
public class TextSearchTerm extends SearchTerm{
public TextSearchTerm(String anEntityPart,String aParamName,String aMatchField,String aDataField, String aTemplateVariable){
partOfEntity = anEntityPart;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
-
+/**
+ * used by indexing and querying
+ * documents based on Topic
+ */
public class TopicSearchTerm extends SearchTerm{
public TopicSearchTerm() {
super(null, "search_topic", "topic", null, null);
import org.apache.lucene.document.Field;
-
+/**
+ * Stores some metatdata for retrieval with a
+ * hit (for example a URL)
+ */
public class UnIndexedSearchTerm extends SearchTerm{
public UnIndexedSearchTerm(String anEntityPart,String aParamName,String aMatchField,String aDataField, String aTemplateVariable){
partOfEntity = anEntityPart;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
-
+/**
+ * not currently used
+ */
public class UnStoredSearchTerm extends SearchTerm{
public UnStoredSearchTerm(String anEntityPart,String aParamName,String aMatchField,String aDataField, String aTemplateVariable){
partOfEntity = anEntityPart;
-
+/**
+ * indexes whether an Enity has video
+ */
public class VideoSearchTerm extends SearchTerm {
public VideoSearchTerm() {
super(null, "search_hasVideo", "hasVideo", null, "hasVideo");