Hi Jan,

It makes sense what you said and I did expect the current out of the box
search to function as you explained. So, I guess I need to modify how the
search queries are built once the criteria is entered in the search box to
accomplish the functionality that I'm expecting. Is this something within
Lucene jar file that I need to modify? Or some where else entirely?

I appreciate your quick and detailed responses on the previous questions.
Thanks.




Jan Haderka-2 wrote:
> 
> 
> What you actually want to study in more details is section of JCR
> specification that explain how CONTAINS() function work.
> What happens during the search is that your search term becomes part of
> the query as 
> SELECT * FROM nt:base WHERE CONTAINS(*, 'term1 OR term2')
> 
> This query returns whatever hits are found be it pages directly or
> paragraphs.
> Then the results are normalized to contain only pages (for the paragraphs
> it would be a page they belong to, so the nearest parent of type
> mgnl:content)
> Then the duplicate pages are removed and the results are displayed.
> ... this obviously works for OR since you don't care which result was
> found, you want to get at least one.
> OTOH it can't work for AND since there you need to do a join of matching
> paragraphs. For such functionality you would need to use different query
> and therefore customize the search functionality ... using STK it should
> be as simple as replacing search model with your own.
> 
> HTH,
> Jan
> 
> On Oct 27, 2010, at 9:11 PM, Anjaan84 wrote:
> 
>> 
>> 
>> Thanks for the quick response Jan.
>> 
>> What you said does make sense. But I have a follow up question about the
>> AND
>> operator:
>> 
>> I know that the built in search engine is Apache Lucene. The problem I am
>> having is getting the AND operator to correctly return search results. It
>> appears in my testing that - if two terms appear in the same paragraph on
>> the same page, the AND operator will correctly return the search result.
>> However, if both of those terms appear in two different paragraphs on the
>> same page, the AND operator does not return the search result correctly.
>> 
>> For example, using the demo-project's News and Events -> Events Overview
>> ->
>> New Year's Eve page:
>> 
>> Scenario 1 - Two terms from two different paragraphs on the same page: 
>> There is an Event Header with the word "Basels" and a content paragraph
>> below it with a term "existent". I performed the search: Basels AND
>> existent. This did not return any results.
>> 
>> Scenario 2 - Two terms from the same paragraph on the same page:  I
>> performed the query: Basels AND myth, which are terms that both appear in
>> the Event Header paragraph. It successfully returned a result.
>> 
>> This leads me to believe that terms that appear in different paragraphs
>> on
>> the same page are not searchable with the AND operator. Is this accurate?
>> I'd like to determine a way to search a page for terms regardless of what
>> paragraph they appear on, using the AND operator.
>> 
>> 
>> 
>> 
>> 
>> 
>> Jan Haderka-2 wrote:
>>> 
>>> 
>>> Occidental OR multimedia
>>> 
>>> ... however you do not get highlighted snippets in this case.
>>> 
>>> HTH,
>>> Jan
>>> 
>>> 
>>> On Oct 26, 2010, at 6:20 PM, Anjaan84 wrote:
>>> 
>>>> 
>>>> 
>>>> Hello,
>>>> 
>>>> I am running into an issue with out of the box search functionality
>>>> provided
>>>> with Magnolia. I did my search on Old Nabble and also searched through
>>>> Magnolia's official documentation website (wiki) to find some/any
>>>> information on Search capabilities and was not able to find anything
>>>> regarding my issue or anything about Search at all. Therefore, I am
>>>> seeking
>>>> help of the community people and hoping someone has already faced a
>>>> similar
>>>> problem and have found a solution.
>>>> 
>>>> Is there a possibility to search for terms that do not necessarily
>>>> exist
>>>> in
>>>> one paragraph or even the same page?
>>>> 
>>>> The easiest way to explain my issue is to provide an example:
>>>> 
>>>> From the Public instance of the demo-project, if I search for the term
>>>> "Occidental" I get 6 results.
>>>> Then I search for another term "Multimedia" and I get 3 results.
>>>> But when I search for both terms together "Multimedia Occidental" I get
>>>> no
>>>> results. I have tried multiple ways of & and Or operators in the search
>>>> string, but did not find anything. It is tough to prove this with Ipsum
>>>> Lorem all the the demo-project, but if you were to try this with your
>>>> own
>>>> original content this issue is easily noticeable.
>>>> 
>>>> Hope this makes sense. Please let me know if anyone have any suggestion
>>>> or
>>>> solution. Greatly appreciate it.
>>>> 
>>>> Thanks.
>>>> -- 
>>>> View this message in context:
>>>> http://old.nabble.com/Search-words-or-terms-from-multiple-paragraphs-or-pages-tp30059235p30059235.html
>>>> Sent from the Magnolia - User mailing list archive at Nabble.com.
>>>> 
>>>> 
>>>> 
>>>> ----------------------------------------------------------------
>>>> For list details see
>>>> http://www.magnolia-cms.com/home/community/mailing-lists.html
>>>> To unsubscribe, E-mail to: <[email protected]>
>>>> ----------------------------------------------------------------
>>> 
>>> 
>>> 
>>> 
>>> ----------------------------------------------------------------
>>> For list details see
>>> http://www.magnolia-cms.com/home/community/mailing-lists.html
>>> To unsubscribe, E-mail to: <[email protected]>
>>> ----------------------------------------------------------------
>>> 
>>> 
>>> 
>> 
>> -- 
>> View this message in context:
>> http://old.nabble.com/Search-words-or-terms-from-multiple-paragraphs-or-pages-tp30059235p30070232.html
>> Sent from the Magnolia - User mailing list archive at Nabble.com.
>> 
>> 
>> 
>> ----------------------------------------------------------------
>> For list details see
>> http://www.magnolia-cms.com/home/community/mailing-lists.html
>> To unsubscribe, E-mail to: <[email protected]>
>> ----------------------------------------------------------------
> 
> 
> 
> 
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/home/community/mailing-lists.html
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Search-words-or-terms-from-multiple-paragraphs-or-pages-tp30059235p30109244.html
Sent from the Magnolia - User mailing list archive at Nabble.com.



----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to