0N/A * The contents of this file are subject to the terms of the 0N/A * Common Development and Distribution License (the "License"). 0N/A * You may not use this file except in compliance with the License. 0N/A * language governing permissions and limitations under the License. 0N/A * When distributing Covered Code, include this CDDL HEADER in each 0N/A * If applicable, add the following below this CDDL HEADER, with the 405N/A * fields enclosed by brackets "[]" replaced with your own identifying 0N/A * information: Portions Copyright [yyyy] [name of copyright owner] 1425N/A * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. 0N/A * This is an encapsulation of the details on how to seach in the index 816N/A * @author Trond Norbye 2005 928N/A * @author Lubos Kosco 2010 - upgrade to lucene 3.0.0 1318N/A * @author Lubos Kosco 2011 - upgrade to lucene 3.5.0 1425N/A * @author Lubos Kosco 2012 - upgrade to lucene 3.6.0 615N/A /** Message text used when logging exceptions thrown when searching. */ 947N/A //NOTE below will need to be changed after new lucene upgrade, if they 947N/A //increase the version - every change of below makes us incompatible with the 947N/A //old index and we need to ask for reindex 947N/A /** version of lucene index common for whole app*/ 0N/A * Holds value of property definition. 0N/A * Holds value of property file. 0N/A * Holds value of property freetext. 0N/A * Holds value of property history. 0N/A * Holds value of property symbol. 0N/A * Holds value of property indexDatabase. 816N/A // internal structure to hold the results from lucene 0N/A * Creates a new instance of SearchEngine 986N/A * Create a QueryBuilder using the fields that have been set on this 986N/A * @return a query builder 1470N/A * Check, whether a query can be build with current information available. 1470N/A * @return {@code true} if a query could be build. 816N/A * @param paging whether to use paging (if yes, first X pages will load faster) 1190N/A * @param root which db to search 816N/A * @param paging whether to use paging (if yes, first X pages will load faster) 816N/A * @param root list of projects to search 1470N/A // TODO there might be a better way for counting this - or we should 1470N/A // honor the command line option here too! 1470N/A * Get the current query used by this instance. Use {@link #isValidQuery()} 1470N/A * @return current query as string 0N/A * Execute a search. Before calling this function, you must set the 0N/A * appropriate seach critera with the set-functions. 816N/A * Note that this search will return the first cachePages of hitsPerPage, for more you need to call more 830N/A * @return The number of hits 1470N/A // TODO optimize if only one project by falling back to 234N/A // search the index database 1470N/A * Get results , if no search was started before, no results are returned 816N/A * this method will requery if end end is more than first query from search, 1470N/A * hence performance hit applies, if you want results in later pages than 816N/A * also end has to be bigger than start ! 816N/A * @param start start of the hit list 816N/A * @param end end of the hit list 1470N/A * @param ret list of results from start to end or null/empty if no search 1470N/A // return if no start search() was done 1470N/A // TODO check if below fits for if end=old hits.length, or it should 1470N/A // do the requery, we want more than 5 pages 1470N/A // should never be hit, since search() will hit this before 1470N/A // TODO generation of ret(results) could be cashed and consumers of 1470N/A // engine would just print them in whatever form they need, this way we 1470N/A // could get rid of docs. The only problem is that count of docs is 1470N/A // usually smaller than number of results 1470N/A // TODO FIX below fragmenter according to either 1470N/A // summarizer or context (to get line numbers, might 1470N/A // be hard, since xref writers will need to be fixed 1470N/A // too, they generate just one line of html code now :( ) 0N/A * Getter for property definition. 0N/A * @return Value of property definition. 0N/A * Setter for property definition. 0N/A * @param definition New value of property definition. 0N/A * Getter for property file. 0N/A * @return Value of property file. 0N/A * Setter for property file. 0N/A * @param file New value of property file. 0N/A * Getter for property freetext. 0N/A * @return Value of property freetext. 0N/A * Setter for property freetext. 0N/A * @param freetext New value of property freetext. 0N/A * Getter for property history. 0N/A * @return Value of property history. 0N/A * Setter for property history. 0N/A * @param history New value of property history. 0N/A * Getter for property symbol. 0N/A * @return Value of property symbol. 0N/A * Setter for property symbol. 0N/A * @param symbol New value of property symbol.