ehatcher 2003/05/29 10:20:19 Modified: contributions/snowball/src/java/org/apache/lucene/analysis/snowball SnowballFilter.java contributions/taglib index.html readme.txt result.jsp contributions/taglib/WEB-INF lucene-taglib.tld web.xml contributions/taglib/WEB-INF/classes/com/netwebapps/taglib/search SearchTag.java SearchTagTei.java Log: new stuff from Bryan Revision Changes Path 1.3 +2 -2 jakarta-lucene-sandbox/contributions/snowball/src/java/org/apache/lucene/analysis/snowball/SnowballFilter.java Index: SnowballFilter.java =================================================================== RCS file: /home/cvs/jakarta-lucene-sandbox/contributions/snowball/src/java/org/apache/lucene/analysis/snowball/SnowballFilter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- SnowballFilter.java 20 Dec 2002 23:05:19 -0000 1.2 +++ SnowballFilter.java 29 May 2003 17:20:18 -0000 1.3 @@ -91,7 +91,7 @@ stemmer = (SnowballProgram) stemClass.newInstance(); stemMethod = stemClass.getMethod("stem", new Class[0]); } catch (Exception e) { - throw new RuntimeException(e); + throw new RuntimeException(); } } @@ -104,7 +104,7 @@ try { stemMethod.invoke(stemmer, EMPTY_ARGS); } catch (Exception e) { - throw new RuntimeException(e); + throw new RuntimeException(); } return new Token(stemmer.getCurrent(), token.startOffset(), token.endOffset(), token.type()); 1.2 +114 -8 jakarta-lucene-sandbox/contributions/taglib/index.html Index: index.html =================================================================== RCS file: /home/cvs/jakarta-lucene-sandbox/contributions/taglib/index.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- index.html 21 May 2003 01:22:22 -0000 1.1 +++ index.html 29 May 2003 17:20:19 -0000 1.2 @@ -1,8 +1,114 @@ - - - Hello World - - - Hello World - - + + + Using Lucene Taglib + + + + +

Test page for Lucene-taglib

+ + + + + + + + + + + + + + + + + + + + + +
Ledgend
Required field  + + This page has been set up so that you can dynamically change the + parameters used by the taglib to produce different results. Hopefully + this tag library is abstract enough to address the majority of situations. + + The ledgend on the left shows which parameters are required and there + default values. If you set throwOnException to false the errors caused by + bad input parameter should not crash the page rather no results will be returned. + On the other hand setting it to true will show any errors encountered by the tag. + Some knowledge of the Lucene search engine is required to take advantage of the + the search tags advanced features such as changing the analyzer and using + fieldList's and flagList's. more documentation on each tag can be found in + the docs directory in the index.html file. + +
Default value 
String 
Object 
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
<LUCENE:Search id="rs"  
throwOnException  
collection"comma separated directory/path(s)"
criteria"String" 
startRow"0" 
maxRows"50" 
analyzerType + +   
search"contents" 
stopWords"comma,separated,list" 
fieldList"comma,separated,list" 
flagList"NORMAL,PROHIBITED,REQUIRED"> 
<%= rs.loopCount %>
int value of the current interation of the search tag
<%= rs.rowCount %>
int value of the current result in hitCount
<%= rs.hitCount %>
int value representing the total number of results
<%= rs.pageCount %>
int value of the offset between the maxrows and the total number of hits
<%= rs.firstPage %>
variable containing the query string needed by a navigation element to return you to the first page of the result
<%= rs.nextPage %>
variable containing the query string needed by a navigation element to move to the next page of the result
<%= rs.previousPage %>
variable containing the query string needed by a navigation element to return to the previous page of the result
<%= rs.lastPage %>
variable containing the query string needed by a navigation element to move to the last page of the result
<%= rs.score %>
returns a string representation of the float value stored in every lucene index as the value score.
if you want to translate it into something useful to a user you will need to create +
new Float(tagid.getField("score")).floatValue() and then you can use your own conversion method
+ as this will return you the original float value that was stored in the index.
<%= rs.pageList %>
returns a LinkedList of query strings needed to produce links to the number of page represented
by the offset of the current page and the maxrows being displayed on each page.
<%= rs.getField(String name) %> used by the Field tag
used to retreive the named field from the index for that iteration of the loop.
If no such name exists in the index such as author the method will return an empty string.
<%= rs.getFields() %> used by the Column tag
used to retrieve a Set view of all of the fields contained in the index for each iteration of the loop,
most generally would be used to write your table headers when the field names are not known until runtime
 <LUCENE:Column id="col" 
 runOnce 
 throwOnException> 
 <%= col.columnCount %> int value of the current iteration of the column tag
 <%= col.columnName %> String value of the field name at columnCount
  <LUCENE:Field id="fld"
  name"<%= col.columnName %>"
  throwOnException>
  <%= fld.value %> String value of the columnName
  </LUCENE:Field> 
 </LUCENE:Column>  
</LUCENE:Search>   
+
+ + \ No newline at end of file 1.2 +48 -10 jakarta-lucene-sandbox/contributions/taglib/readme.txt Index: readme.txt =================================================================== RCS file: /home/cvs/jakarta-lucene-sandbox/contributions/taglib/readme.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- readme.txt 12 May 2003 14:02:35 -0000 1.1 +++ readme.txt 29 May 2003 17:20:19 -0000 1.2 @@ -16,18 +16,56 @@ DOCUMENTATION: you will find documentation and an over view of the tag library in the docs folder of this project and the javadocs in the api folder -respectivley. +respectively. BUGS: I tried to create a .war file for this project but I am having trouble getting it to deploy properly. -PLANNED: -I am planning to document the result.jsp file line for line to explain -how to display a search result when you do not know what the names of -the search fields stored in the lucene-index. That is the way the result -page is currently written. - -Time permitting I want to write a couple of child tags for telling the search -tag that there are multiple index to be searched and to let it do the other -types of searches such as fuzzy and range queries. \ No newline at end of file +More like a heads up than a bug I discovered that if you have tag pooling \ +turned on in Tomcat that values passed to a custom tag will not change in +the event that an exception is thrown. Catching the exception inside of +the tag or page does not help, to update the values at this point you +have to turn off tag pooling. Follow the instructions below to do this +in Tomcat. + +---------------------------------------------------------------------------- + + From: Bill Barker + Subject: Re: HELP:Tagpool sharing problems + Date: Mon, 28 Apr 2003 22:20:20 -0700 + +---------------------------------------------------------------------------- + +In $CATALINA_HOME/conf/web.xml, locate the jsp +servlet, and add: + + enablePooling + false + + +This will turn off tag-pooling. You'll also need to clear out +$CATALINA_HOME/work so that the JSP pages get re-compiled. + +If you just want it turned off for one context, then you can place the +definition of the jsp servlet in your own web.xml. + +If you are using: + + myJspPage + myJspPage.jsp + +then you also need to add the enablePooling init-param to your servlet's +definition. + + +HISTORY: +1. Added more robust error handling and the ability to turn it on and + off with a throwOnException attribute. (All tags) +2. Added a Column tag for outputting the field names found in a + Lucene index. +3. Added a Field tag for retrieving a value for a field in a search + result either produced by the Column tag or known in advance. +4. Added new example pages to illustrate how to use the new tags +5. The Collection tag has been deprecated, use the collection attribute + of the Search tag instead. \ No newline at end of file 1.3 +116 -41 jakarta-lucene-sandbox/contributions/taglib/result.jsp Index: result.jsp =================================================================== RCS file: /home/cvs/jakarta-lucene-sandbox/contributions/taglib/result.jsp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- result.jsp 21 May 2003 01:22:22 -0000 1.2 +++ result.jsp 29 May 2003 17:20:19 -0000 1.3 @@ -1,53 +1,92 @@ -<%@ taglib uri="/WEB-INF/lucene-taglib.tld" prefix="JSP"%> -<%@ include file="header.jsp"%> +<%@ taglib uri="/WEB-INF/lucene-taglib.tld" prefix="LUCENE"%> <%@ page import="java.util.*"%> - + + + Using Lucene Taglib + + + <% - String startRow = "0"; - String maxRows = "10"; - String query = request.getParameter("query"); + String startRow = ""; + String maxRows = ""; + String criteria = ""; + int colCount = 0; + String analyzerType = "STANDARD_ANALYZER"; + String search = "contents"; + String stopWords=""; + String fieldList=""; + String flagList=""; + String collection = "E:/search/lucene/index,E:/opt/lucene/index"; + String throwOnException = "false"; + String fieldthrowOnException = "false"; + String columnthrowOnException = "false"; + String runOnce = "false"; + String query = ""; + try{ + query = request.getQueryString(); + criteria = request.getParameter("criteria"); startRow = request.getParameter("startRow"); maxRows = request.getParameter("maxRows"); + analyzerType = request.getParameter("analyzerType"); + search = request.getParameter("search"); + stopWords = request.getParameter("stopWords"); + fieldList = request.getParameter("fieldList"); + flagList = request.getParameter("flagList"); + throwOnException = request.getParameter("throwOnException"); + fieldthrowOnException = request.getParameter("fieldthrowOnException"); + columnthrowOnException = request.getParameter("columnthrowOnException"); + runOnce = request.getParameter("runOnce"); } catch(Exception e){ } %> - +

Search results for "<%= criteria %>"

- - <% - - Set allFields = rs.getFields(); - int fieldSize = allFields.size(); - Iterator fieldIter = allFields.iterator(); - - while(fieldIter.hasNext()){ - String nextField = (String) fieldIter.next(); - if(!nextField.equalsIgnoreCase("summary")){ - %> - - <% - }else{ - %> - - - <% - } - } - - %> - + + + + <% colCount = header.columnCount; %> + + + + + + + + + + <% - int count = 0; - try{ - count = new Integer(rs.hitCount).intValue(); - }catch(Exception e){ - out.print(e); - } - if(count <= 0){ + if(rs.hitCount <= 0){ %> @@ -56,9 +95,45 @@ } %> - + + + + + + + + + + + + + + + + + + + + + + + + + -
<%= nextField %><%= rs.getField(nextField) %>
<%= rs.hitCount %>|<%= nextField %>
<%= rs.getField(nextField) %>
<%= header.columnName %>
[<%= rs.loopCount %>][<%= rs.rowCount %>]  + + + <% if(col.columnName.equalsIgnoreCase("url")){ %> + + <% } %> + + <%= fld.value %> + + <% if(col.columnName.equalsIgnoreCase("url")){ %> + + <% } %> + + +
No results have been found
<%= rs.hitCount %>hitCount<%= rs.hitCount %>
pageCount<%= rs.pageCount %>
firstPage<%= rs.firstPage %>
nextPage<%= rs.nextPage %>
previousPage<%= rs.previousPage %>
lastPage<%= rs.lastPage %>
+ +
- -<%@include file="footer.jsp"%> + + + \ No newline at end of file 1.3 +65 -4 jakarta-lucene-sandbox/contributions/taglib/WEB-INF/lucene-taglib.tld Index: lucene-taglib.tld =================================================================== RCS file: /home/cvs/jakarta-lucene-sandbox/contributions/taglib/WEB-INF/lucene-taglib.tld,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- lucene-taglib.tld 21 May 2003 01:22:22 -0000 1.2 +++ lucene-taglib.tld 29 May 2003 17:20:19 -0000 1.3 @@ -34,7 +34,7 @@ collection - false + true true @@ -47,16 +47,77 @@ false true + + analyzerType + false + true + + + fieldList + false + true + + + flagList + false + true + + + search + false + true + + + stopWords + false + true + - Collection - com.netwebapps.taglib.search.CollectionTag + Column + com.netwebapps.taglib.search.ColumnTag + com.netwebapps.taglib.search.ColumnTagTei + JSP Adds an additional collection to the search tag. - directory + id + true + true + + + runOnce + false + true + + + throwOnException + false + true + + + + Field + com.netwebapps.taglib.search.FieldTag + com.netwebapps.taglib.search.FieldTagTei + JSP + + Output the value for the named field in a search result, empty by default. + + + id true + true + + + name + true + true + + + throwOnException + false true 1.2 +1 -1 jakarta-lucene-sandbox/contributions/taglib/WEB-INF/web.xml Index: web.xml =================================================================== RCS file: /home/cvs/jakarta-lucene-sandbox/contributions/taglib/WEB-INF/web.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- web.xml 12 May 2003 14:02:36 -0000 1.1 +++ web.xml 29 May 2003 17:20:19 -0000 1.2 @@ -7,8 +7,8 @@ 30 - index.jsp index.html + index.jsp index.htm 1.3 +272 -54 jakarta-lucene-sandbox/contributions/taglib/WEB-INF/classes/com/netwebapps/taglib/search/SearchTag.java Index: SearchTag.java =================================================================== RCS file: /home/cvs/jakarta-lucene-sandbox/contributions/taglib/WEB-INF/classes/com/netwebapps/taglib/search/SearchTag.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- SearchTag.java 21 May 2003 01:22:22 -0000 1.2 +++ SearchTag.java 29 May 2003 17:20:19 -0000 1.3 @@ -1,21 +1,37 @@ package com.netwebapps.taglib.search; +import java.io.File; +import java.io.IOException; import java.util.*; -import javax.servlet.jsp.*; -import javax.servlet.jsp.tagext.*; -import javax.servlet.http.*; -import java.io.*; - -import org.apache.lucene.analysis.*; -import org.apache.lucene.document.*; -import org.apache.lucene.index.*; -import org.apache.lucene.search.*; -import org.apache.lucene.queryParser.*; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.PageContext; +import javax.servlet.jsp.tagext.BodyTagSupport; + +import org.apache.lucene.analysis.Analyzer; +import org.apache.lucene.analysis.SimpleAnalyzer; +import org.apache.lucene.analysis.StopAnalyzer; +import org.apache.lucene.analysis.WhitespaceAnalyzer; +import org.apache.lucene.analysis.de.GermanAnalyzer; +import org.apache.lucene.analysis.de.WordlistLoader; +import org.apache.lucene.analysis.standard.StandardAnalyzer; +import org.apache.lucene.document.Document; +import org.apache.lucene.document.Field; +import org.apache.lucene.index.IndexReader; +import org.apache.lucene.queryParser.ParseException; +import org.apache.lucene.queryParser.QueryParser; +import org.apache.lucene.queryParser.MultiFieldQueryParser; +import org.apache.lucene.search.Hits; +import org.apache.lucene.search.IndexSearcher; +import org.apache.lucene.search.MultiSearcher; +import org.apache.lucene.search.Query; /* * - * @author Bryan LaPlante - * @param + * @company Network Web Application + * @url http://www.netwebapps.com + * @author Bryan LaPlante * */ public class SearchTag extends BodyTagSupport{ @@ -32,49 +48,52 @@ private Enumeration fields = null; private HashMap aField = new HashMap(); private int ROWCOUNT = 0; - private int PAGECOUNT = 1; + private int PAGECOUNT = 0; private int HITCOUNT = 0; private boolean abort = false; private Analyzer analyzer = null; + private Document doc = null; + private ArrayList idxArray = new ArrayList(); + private MultiSearcher msearcher = null; + private final int GERMANAN_ALYZER = 0; + private final int SIMPLE_ANALYZER = 1; + private final int STANDARD_ANALYZER = 2; + private final int STOP_ANALYZER = 3; + private final int WHITESPACE_ANALYZER = 4; public int startRow = 0; public int maxRows = 50; - public String rowCount = "0"; - public String pageCount = "1"; - public String hitCount = "0"; + public int rowCount = 0; + public int pageCount = 1; + public int hitCount = 0; + public int loopCount = 0; public String firstPage = ""; public String nextPage = ""; public String previousPage = ""; public String lastPage = ""; public LinkedList pageList = new LinkedList(); public boolean throwOnException = false; + public String[] stopWords = new String[0]; + public String[] fieldList = new String[0]; + public int[] flagList = new int[0]; + public String search = "contents"; + public int analyzerType = STANDARD_ANALYZER; public int doStartTag() throws JspException{ - - doSearch(); - if(abort){ - rowCount = new Integer(startRow + ROWCOUNT).toString(); - pageContext.setAttribute(getId(),this,PageContext.PAGE_SCOPE); - return SKIP_BODY; - } - searchItr = hitArray.iterator(); - if(searchItr.hasNext()){ - aField = (HashMap) searchItr.next(); - rowCount = new Integer(startRow + ROWCOUNT++).toString(); - pageContext.setAttribute(getId(),this,PageContext.PAGE_SCOPE); - return EVAL_BODY_AGAIN; - } - return SKIP_BODY; + rowCount = startRow + ROWCOUNT++; + loopCount++; + pageContext.setAttribute(getId(),this,PageContext.PAGE_SCOPE); + return EVAL_BODY_AGAIN; } public void doInitBody() throws JspException{ + doSearch(); if(!abort){ - doSearch(); searchItr = hitArray.iterator(); if(searchItr.hasNext()){ aField = (HashMap) searchItr.next(); - rowCount = new Integer(startRow + ROWCOUNT).toString(); + rowCount = startRow + ROWCOUNT++; pageContext.setAttribute(getId(),this,PageContext.PAGE_SCOPE); } } @@ -83,7 +102,9 @@ public int doAfterBody() throws JspException{ if(abort){ - rowCount = new Integer(startRow + ROWCOUNT).toString(); + hitCount = 0; + loopCount = 0; + rowCount = startRow + ROWCOUNT; pageContext.setAttribute(getId(),this,PageContext.PAGE_SCOPE); return SKIP_BODY; } @@ -98,7 +119,8 @@ if(searchItr.hasNext()){ aField = (HashMap) searchItr.next(); - rowCount = new Integer(startRow + ROWCOUNT++).toString(); + rowCount = startRow + ROWCOUNT++; + loopCount++; pageContext.setAttribute(getId(),this,PageContext.PAGE_SCOPE); return EVAL_BODY_AGAIN; } @@ -108,6 +130,8 @@ public int doEndTag() throws JspException{ if(abort){ + hitCount = 0; + pageContext.setAttribute(getId(),this,PageContext.PAGE_SCOPE); return EVAL_PAGE; } @@ -135,6 +159,25 @@ } public void release(){ + hitMap = null; + hitArray = null; + collection = ""; + searcher = null; + query = null; + hits = null; + thispage = 0; + criteria = ""; + searchItr = null; + fields = null; + aField = new HashMap(); + ROWCOUNT = 0; + PAGECOUNT = 1; + HITCOUNT = 0; + abort = false; + analyzer = null; + doc = null; + idxArray = null; + msearcher = null; } public String getField(String name){ @@ -150,10 +193,32 @@ return aField.keySet(); } + + public void addCollection(String name) throws JspException{ + try { + searcher = new IndexSearcher(IndexReader.open(name)); + idxArray.add(searcher); + } catch (IOException e) { + if(throwOnException){ + throw new JspException("Error occured while opening " + name + " ]: " + e); + } + } + } + public void doSearch() throws JspException{ try { - searcher = new IndexSearcher(IndexReader.open(collection)); + if(idxArray.size() > 0){ + IndexSearcher[] idxToArray = new IndexSearcher[idxArray.size()]; + Iterator idxIter = idxArray.iterator(); + int arrayCount = 0; + while(idxIter.hasNext()){ + idxToArray[arrayCount++] = (IndexSearcher) idxIter.next(); + } + msearcher = new MultiSearcher(idxToArray); + }else{ + throw new JspException("No collection has been specified"); + } } catch (IOException e) { if(throwOnException){ throw new JspException("IndexSearcher(IndexReader.open(collection)): " + e); @@ -161,31 +226,80 @@ abort = true; } if(!abort){ - analyzer = new StopAnalyzer(); + // choosing the type of analyzer to use in this search + switch (analyzerType) { + case GERMANAN_ALYZER: + if(stopWords.length > 0){ + analyzer = new GermanAnalyzer(stopWords); + }else{ + if(throwOnException){ + throw new JspException("In order to use a GermanAnalyzer you must provide a list of stop words"); + } + abort = true; + } + break; + case SIMPLE_ANALYZER: + analyzer = new SimpleAnalyzer(); + break; + case STANDARD_ANALYZER: + if(stopWords.length > 0){ + analyzer = new StandardAnalyzer(stopWords); + }else{ + analyzer = new StandardAnalyzer(); + } + break; + case STOP_ANALYZER: + if(stopWords.length > 0){ + analyzer = new StopAnalyzer(stopWords); + }else{ + analyzer = new StopAnalyzer(); + } + break; + case WHITESPACE_ANALYZER: + analyzer = new WhitespaceAnalyzer(); + break; + + default : + if(stopWords.length > 0){ + analyzer = new StandardAnalyzer(stopWords); + }else{ + analyzer = new StandardAnalyzer(); + } + break; + } try { - query = QueryParser.parse(criteria, "contents", analyzer); + // choose a query parser + if(fieldList.length > 0){ + if(flagList.length > 0){ + query = MultiFieldQueryParser.parse(criteria,fieldList,flagList,analyzer); + }else{ + query = MultiFieldQueryParser.parse(criteria,fieldList,analyzer); + } + }else{ + query = QueryParser.parse(criteria, search, analyzer); + } } catch (ParseException e) { if(throwOnException){ - throw new JspException("QueryParser.parse(criteria,contents,analyzer): " + e); + throw new JspException("If using fieldList and or flagList check to see you have the same number of items in each: " + e); } abort = true; } if(!abort){ try { - hits = searcher.search(query); + hits = msearcher.search(query); } catch (IOException e) { if(throwOnException){ - throw new JspException("searcher.search(query): " + e); + throw new JspException("msearcher.search(query): " + e); } abort = true; } if(!abort){ - hitCount = new Integer(hits.length()).toString(); + hitCount = hits.length(); HITCOUNT = hits.length(); - PAGECOUNT = PAGECOUNT = (int) (( (double) startRow) / maxRows ); - pageCount = new Integer(PAGECOUNT).toString(); + PAGECOUNT = (int) (( (double) startRow) / maxRows ); + pageCount = PAGECOUNT; thispage = maxRows; if ((startRow + maxRows) > hits.length()) { thispage = hits.length() - startRow; @@ -193,7 +307,6 @@ hitArray = new ArrayList(); for (int i = startRow; i < (thispage + startRow); i++) { hitMap = new HashMap(); - Document doc = null; try { doc = hits.doc(i); } catch (IOException e) { @@ -225,11 +338,16 @@ } } } - } - - /* setters */ - - + if(msearcher != null){ + try { + msearcher.close(); + } catch (IOException e) { + if(throwOnException){ + throw new JspException("A problem occured trying to close the searcher : " + e); + } + } + } + } public void setCriteria(String criteria){ this.criteria = criteria; @@ -261,15 +379,20 @@ this.maxRows = maxRows; } - public void setCollection(String collection){ - this.collection = collection; + public void setCollection(String collection) throws JspException{ + idxArray = new ArrayList(); + String[] collectionArray = collection.split(","); + for(int i=0; i 0){ + String[] words = swords.split(","); + for (int i = 0; i < words.length; i++) { + if(new File(words[i]).isFile()){ + wordTable.putAll(WordlistLoader.getWordtable(words[i])); + }else{ + wordTable.put(words[i], words[i]); + } + } + temp = new String[wordTable.size()]; + + int count = 0; + if(wordTable.size() > 0){ + Iterator wtIter = wordTable.keySet().iterator(); + while (wtIter.hasNext()){ + temp[count++] = (String) wtIter.next(); + } + } + } + stopWords = temp; + } + +// public void setStopWords(String[] swords) throws JspException{ +// stopWords = swords; +// } + + /** + * @param string + */ + public void setFlagList(String fg) { + int[] list = new int[0]; + if(fg.split(",").length > 0){ + String[] ssplit = fg.split(","); + Integer fsplit = new Integer(fg.split(",").length); + list = new int[fsplit.intValue()]; + for(int i=0; i < fsplit.intValue(); i++){ + if(ssplit[i].equalsIgnoreCase("NORMAL")){ + list[i] = MultiFieldQueryParser.NORMAL_FIELD; + }else if(ssplit[i].equalsIgnoreCase("PROHIBITED")){ + list[i] = MultiFieldQueryParser.PROHIBITED_FIELD; + }else if(ssplit[i].equalsIgnoreCase("REQUIRED")){ + list[i] = MultiFieldQueryParser.REQUIRED_FIELD; + } + } + } + flagList = list; + } + + /** + * @param string + */ + public void setFieldList(String fl) { + if(fl.split(",").length > 0){ + fieldList = fl.split(","); + } + } + /** + * @param string + */ + public void setFieldList(String[] fl) { + fieldList = fl; + } + + /** + * @param string + */ + public void setSearch(String string) { + search = string; + } + + /** + * @param string + */ + public void setAnalyzerType(String atype) { + if(atype.equalsIgnoreCase("GERMANAN_ALYZER")){ + analyzerType = 0; + }else if(atype.equalsIgnoreCase("SIMPLE_ANALYZER")){ + analyzerType = 1; + }else if(atype.equalsIgnoreCase("STANDARD_ANALYZER")){ + analyzerType = 2; + }else if(atype.equalsIgnoreCase("STOP_ANALYZER")){ + analyzerType = 3; + }else if(atype.equalsIgnoreCase("WHITESPACE_ANALYZER")){ + analyzerType = 4; + }else{ + analyzerType = 2; + } + } + } 1.2 +2 -1 jakarta-lucene-sandbox/contributions/taglib/WEB-INF/classes/com/netwebapps/taglib/search/SearchTagTei.java Index: SearchTagTei.java =================================================================== RCS file: /home/cvs/jakarta-lucene-sandbox/contributions/taglib/WEB-INF/classes/com/netwebapps/taglib/search/SearchTagTei.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- SearchTagTei.java 12 May 2003 14:02:36 -0000 1.1 +++ SearchTagTei.java 29 May 2003 17:20:19 -0000 1.2 @@ -1,7 +1,8 @@ package com.netwebapps.taglib.search; /** - * @author Network Web Application + * @company Network Web Application + * @url http://www.netwebapps.com * @author Bryan LaPlante * */ --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-dev-help@jakarta.apache.org