Re: svn commit: r1794770 - in /ofbiz/ofbiz-plugins/trunk/lucene: ./ groovyScripts/content/ src/main/java/org/apache/ofbiz/content/search/

2017-07-27 Thread Renuka Srishti
Thanks Jacques :)

On Wed, Jul 26, 2017 at 10:56 PM, Jacques Le Roux <
jacques.le.r...@les7arts.com> wrote:

> Thanks Renuka,
>
> I also spotted something but you beat me on it :)
>
> Jacques
>
>
> Le 17/07/2017 à 15:31, Renuka Srishti a écrit :
>
>> Hii,
>>
>> I think during the solr/lucene version update, few changes are reverted
>> like *"combQuery = new BooleanQuery.Builder()" *in
>> lucene/groovyScripts/content/Search.groovy. The issue reported for the
>> same
>> changes is OFBIZ-9301 .
>>
>>
>> Thanks
>>
>> On Thu, May 11, 2017 at 5:28 AM,  wrote:
>>
>> Author: shijh
>>> Date: Wed May 10 23:58:31 2017
>>> New Revision: 1794770
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1794770=rev
>>> Log:
>>> Fixed: Update Apache Solr/Lucene to release 6.2.1
>>> OFBIZ-8316
>>>
>>> Updated Lucene from 6.2.1 to 6.5.1 and the point fields generated by
>>> Lucene are ok now for Solr component.
>>>
>>> Thanks: Cao Pengan for the patch and Jacques, Michael for the comments
>>> and
>>> reviews.
>>>
>>> Modified:
>>>  ofbiz/ofbiz-plugins/trunk/lucene/build.gradle
>>>  ofbiz/ofbiz-plugins/trunk/lucene/groovyScripts/content/Sear
>>> ch.groovy
>>>  ofbiz/ofbiz-plugins/trunk/lucene/groovyScripts/content/
>>> SearchProducts.groovy
>>>  ofbiz/ofbiz-plugins/trunk/lucene/src/main/java/org/
>>> apache/ofbiz/content/search/ProductDocument.java
>>>  ofbiz/ofbiz-plugins/trunk/lucene/src/main/java/org/
>>> apache/ofbiz/content/search/SearchWorker.java
>>>
>>> Modified: ofbiz/ofbiz-plugins/trunk/lucene/build.gradle
>>> URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/
>>> lucene/build.gradle?rev=1794770=1794769=1794770=diff
>>> 
>>> ==
>>> --- ofbiz/ofbiz-plugins/trunk/lucene/build.gradle (original)
>>> +++ ofbiz/ofbiz-plugins/trunk/lucene/build.gradle Wed May 10 23:58:31
>>> 2017
>>> @@ -17,7 +17,7 @@
>>>* under the License.
>>>*/
>>>   dependencies {
>>> -pluginLibsCompile 'org.apache.lucene:lucene-core:6.2.1'
>>> -pluginLibsCompile 'org.apache.lucene:lucene-queryparser:6.2.1'
>>> -pluginLibsCompile 'org.apache.lucene:lucene-analyzers-common:6.2.1'
>>> +pluginLibsCompile 'org.apache.lucene:lucene-core:6.5.1'
>>> +pluginLibsCompile 'org.apache.lucene:lucene-queryparser:6.5.1'
>>> +pluginLibsCompile 'org.apache.lucene:lucene-analyzers-common:6.5.1'
>>>   }
>>> \ No newline at end of file
>>>
>>> Modified: ofbiz/ofbiz-plugins/trunk/lucene/groovyScripts/content/
>>> Search.groovy
>>> URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/
>>> lucene/groovyScripts/content/Search.groovy?rev=1794770=
>>> 1794769=1794770=diff
>>> 
>>> ==
>>> --- ofbiz/ofbiz-plugins/trunk/lucene/groovyScripts/content/Search.groovy
>>> (original)
>>> +++ ofbiz/ofbiz-plugins/trunk/lucene/groovyScripts/content/Search.groovy
>>> Wed May 10 23:58:31 2017
>>> @@ -22,15 +22,13 @@ import org.apache.lucene.document.Docume
>>>   import org.apache.lucene.index.Term
>>>   import org.apache.lucene.queryparser.classic.QueryParser
>>>   import org.apache.lucene.store.FSDirectory
>>> -import org.apache.lucene.search.*
>>> -import org.apache.lucene.index.DirectoryReader
>>> -
>>>   import org.apache.ofbiz.base.util.UtilHttp
>>>   import org.apache.ofbiz.content.search.SearchWorker
>>>   import org.apache.ofbiz.product.feature.ParametricSearch
>>> +import org.apache.lucene.search.*
>>> +import org.apache.lucene.index.DirectoryReader
>>>   import org.apache.ofbiz.base.util.UtilProperties
>>>
>>> -
>>>   queryLine = parameters.queryLine
>>>
>>>   siteId = parameters.lcSiteId
>>> @@ -41,7 +39,7 @@ searchFeature3 = (String) parameters.SEA
>>>
>>>   featureIdByType = ParametricSearch.makeFeatureIdByTypeMap(
>>> UtilHttp.getParameterMap(request))
>>>
>>> -combQuery = new BooleanQuery.Builder()
>>> +combQuery = new BooleanQuery()
>>>
>>>   try {
>>>   DirectoryReader reader = DirectoryReader.open(FSDirectory.open(new
>>> File(SearchWorker.getIndexPath("content")).toPath()))
>>> @@ -66,7 +64,7 @@ if (queryLine || siteId) {
>>>   }
>>>
>>>   if (searchFeature1 || searchFeature2 || searchFeature3 ||
>>> !featureIdByType.isEmpty()) {
>>> -featureQuery = new BooleanQuery.Builder()
>>> +featureQuery = new BooleanQuery()
>>>   featuresRequired = BooleanClause.Occur.MUST
>>>   if ("any".equals(parameters.any_or_all)) {
>>>   featuresRequired = BooleanClause.Occur.SHOULD
>>> @@ -92,12 +90,12 @@ if (searchFeature1 || searchFeature2 ||
>>>   termQuery = new TermQuery(new Term("feature", value))
>>>   featureQuery.add(termQuery, featuresRequired)
>>>   }
>>> -combQuery.add(featureQuery.build(), featuresRequired)
>>> +combQuery.add(featureQuery, featuresRequired)
>>>   }
>>>   }
>>>   if (searcher) {
>>>   TopScoreDocCollector collector 

Re: svn commit: r1794770 - in /ofbiz/ofbiz-plugins/trunk/lucene: ./ groovyScripts/content/ src/main/java/org/apache/ofbiz/content/search/

2017-07-26 Thread Jacques Le Roux

Thanks Renuka,

I also spotted something but you beat me on it :)

Jacques


Le 17/07/2017 à 15:31, Renuka Srishti a écrit :

Hii,

I think during the solr/lucene version update, few changes are reverted
like *"combQuery = new BooleanQuery.Builder()" *in
lucene/groovyScripts/content/Search.groovy. The issue reported for the same
changes is OFBIZ-9301 .

Thanks

On Thu, May 11, 2017 at 5:28 AM,  wrote:


Author: shijh
Date: Wed May 10 23:58:31 2017
New Revision: 1794770

URL: http://svn.apache.org/viewvc?rev=1794770=rev
Log:
Fixed: Update Apache Solr/Lucene to release 6.2.1
OFBIZ-8316

Updated Lucene from 6.2.1 to 6.5.1 and the point fields generated by
Lucene are ok now for Solr component.

Thanks: Cao Pengan for the patch and Jacques, Michael for the comments and
reviews.

Modified:
 ofbiz/ofbiz-plugins/trunk/lucene/build.gradle
 ofbiz/ofbiz-plugins/trunk/lucene/groovyScripts/content/Search.groovy
 ofbiz/ofbiz-plugins/trunk/lucene/groovyScripts/content/
SearchProducts.groovy
 ofbiz/ofbiz-plugins/trunk/lucene/src/main/java/org/
apache/ofbiz/content/search/ProductDocument.java
 ofbiz/ofbiz-plugins/trunk/lucene/src/main/java/org/
apache/ofbiz/content/search/SearchWorker.java

Modified: ofbiz/ofbiz-plugins/trunk/lucene/build.gradle
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/
lucene/build.gradle?rev=1794770=1794769=1794770=diff

==
--- ofbiz/ofbiz-plugins/trunk/lucene/build.gradle (original)
+++ ofbiz/ofbiz-plugins/trunk/lucene/build.gradle Wed May 10 23:58:31 2017
@@ -17,7 +17,7 @@
   * under the License.
   */
  dependencies {
-pluginLibsCompile 'org.apache.lucene:lucene-core:6.2.1'
-pluginLibsCompile 'org.apache.lucene:lucene-queryparser:6.2.1'
-pluginLibsCompile 'org.apache.lucene:lucene-analyzers-common:6.2.1'
+pluginLibsCompile 'org.apache.lucene:lucene-core:6.5.1'
+pluginLibsCompile 'org.apache.lucene:lucene-queryparser:6.5.1'
+pluginLibsCompile 'org.apache.lucene:lucene-analyzers-common:6.5.1'
  }
\ No newline at end of file

Modified: ofbiz/ofbiz-plugins/trunk/lucene/groovyScripts/content/
Search.groovy
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/
lucene/groovyScripts/content/Search.groovy?rev=1794770=
1794769=1794770=diff

==
--- ofbiz/ofbiz-plugins/trunk/lucene/groovyScripts/content/Search.groovy
(original)
+++ ofbiz/ofbiz-plugins/trunk/lucene/groovyScripts/content/Search.groovy
Wed May 10 23:58:31 2017
@@ -22,15 +22,13 @@ import org.apache.lucene.document.Docume
  import org.apache.lucene.index.Term
  import org.apache.lucene.queryparser.classic.QueryParser
  import org.apache.lucene.store.FSDirectory
-import org.apache.lucene.search.*
-import org.apache.lucene.index.DirectoryReader
-
  import org.apache.ofbiz.base.util.UtilHttp
  import org.apache.ofbiz.content.search.SearchWorker
  import org.apache.ofbiz.product.feature.ParametricSearch
+import org.apache.lucene.search.*
+import org.apache.lucene.index.DirectoryReader
  import org.apache.ofbiz.base.util.UtilProperties

-
  queryLine = parameters.queryLine

  siteId = parameters.lcSiteId
@@ -41,7 +39,7 @@ searchFeature3 = (String) parameters.SEA

  featureIdByType = ParametricSearch.makeFeatureIdByTypeMap(
UtilHttp.getParameterMap(request))

-combQuery = new BooleanQuery.Builder()
+combQuery = new BooleanQuery()

  try {
  DirectoryReader reader = DirectoryReader.open(FSDirectory.open(new
File(SearchWorker.getIndexPath("content")).toPath()))
@@ -66,7 +64,7 @@ if (queryLine || siteId) {
  }

  if (searchFeature1 || searchFeature2 || searchFeature3 ||
!featureIdByType.isEmpty()) {
-featureQuery = new BooleanQuery.Builder()
+featureQuery = new BooleanQuery()
  featuresRequired = BooleanClause.Occur.MUST
  if ("any".equals(parameters.any_or_all)) {
  featuresRequired = BooleanClause.Occur.SHOULD
@@ -92,12 +90,12 @@ if (searchFeature1 || searchFeature2 ||
  termQuery = new TermQuery(new Term("feature", value))
  featureQuery.add(termQuery, featuresRequired)
  }
-combQuery.add(featureQuery.build(), featuresRequired)
+combQuery.add(featureQuery, featuresRequired)
  }
  }
  if (searcher) {
  TopScoreDocCollector collector = TopScoreDocCollector.create(100)
//defaulting to 100 results
-searcher.search(combQuery.build(), collector)
+searcher.search(combQuery, collector)
  ScoreDoc[] hits = collector.topDocs().scoreDocs

  contentList = [] as ArrayList

Modified: ofbiz/ofbiz-plugins/trunk/lucene/groovyScripts/content/
SearchProducts.groovy
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/
lucene/groovyScripts/content/SearchProducts.groovy?rev=
1794770=1794769=1794770=diff

==
--- 

Re: svn commit: r1794770 - in /ofbiz/ofbiz-plugins/trunk/lucene: ./ groovyScripts/content/ src/main/java/org/apache/ofbiz/content/search/

2017-07-17 Thread Renuka Srishti
Hii,

I think during the solr/lucene version update, few changes are reverted
like *"combQuery = new BooleanQuery.Builder()" *in
lucene/groovyScripts/content/Search.groovy. The issue reported for the same
changes is OFBIZ-9301 .

Thanks

On Thu, May 11, 2017 at 5:28 AM,  wrote:

> Author: shijh
> Date: Wed May 10 23:58:31 2017
> New Revision: 1794770
>
> URL: http://svn.apache.org/viewvc?rev=1794770=rev
> Log:
> Fixed: Update Apache Solr/Lucene to release 6.2.1
> OFBIZ-8316
>
> Updated Lucene from 6.2.1 to 6.5.1 and the point fields generated by
> Lucene are ok now for Solr component.
>
> Thanks: Cao Pengan for the patch and Jacques, Michael for the comments and
> reviews.
>
> Modified:
> ofbiz/ofbiz-plugins/trunk/lucene/build.gradle
> ofbiz/ofbiz-plugins/trunk/lucene/groovyScripts/content/Search.groovy
> ofbiz/ofbiz-plugins/trunk/lucene/groovyScripts/content/
> SearchProducts.groovy
> ofbiz/ofbiz-plugins/trunk/lucene/src/main/java/org/
> apache/ofbiz/content/search/ProductDocument.java
> ofbiz/ofbiz-plugins/trunk/lucene/src/main/java/org/
> apache/ofbiz/content/search/SearchWorker.java
>
> Modified: ofbiz/ofbiz-plugins/trunk/lucene/build.gradle
> URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/
> lucene/build.gradle?rev=1794770=1794769=1794770=diff
> 
> ==
> --- ofbiz/ofbiz-plugins/trunk/lucene/build.gradle (original)
> +++ ofbiz/ofbiz-plugins/trunk/lucene/build.gradle Wed May 10 23:58:31 2017
> @@ -17,7 +17,7 @@
>   * under the License.
>   */
>  dependencies {
> -pluginLibsCompile 'org.apache.lucene:lucene-core:6.2.1'
> -pluginLibsCompile 'org.apache.lucene:lucene-queryparser:6.2.1'
> -pluginLibsCompile 'org.apache.lucene:lucene-analyzers-common:6.2.1'
> +pluginLibsCompile 'org.apache.lucene:lucene-core:6.5.1'
> +pluginLibsCompile 'org.apache.lucene:lucene-queryparser:6.5.1'
> +pluginLibsCompile 'org.apache.lucene:lucene-analyzers-common:6.5.1'
>  }
> \ No newline at end of file
>
> Modified: ofbiz/ofbiz-plugins/trunk/lucene/groovyScripts/content/
> Search.groovy
> URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/
> lucene/groovyScripts/content/Search.groovy?rev=1794770=
> 1794769=1794770=diff
> 
> ==
> --- ofbiz/ofbiz-plugins/trunk/lucene/groovyScripts/content/Search.groovy
> (original)
> +++ ofbiz/ofbiz-plugins/trunk/lucene/groovyScripts/content/Search.groovy
> Wed May 10 23:58:31 2017
> @@ -22,15 +22,13 @@ import org.apache.lucene.document.Docume
>  import org.apache.lucene.index.Term
>  import org.apache.lucene.queryparser.classic.QueryParser
>  import org.apache.lucene.store.FSDirectory
> -import org.apache.lucene.search.*
> -import org.apache.lucene.index.DirectoryReader
> -
>  import org.apache.ofbiz.base.util.UtilHttp
>  import org.apache.ofbiz.content.search.SearchWorker
>  import org.apache.ofbiz.product.feature.ParametricSearch
> +import org.apache.lucene.search.*
> +import org.apache.lucene.index.DirectoryReader
>  import org.apache.ofbiz.base.util.UtilProperties
>
> -
>  queryLine = parameters.queryLine
>
>  siteId = parameters.lcSiteId
> @@ -41,7 +39,7 @@ searchFeature3 = (String) parameters.SEA
>
>  featureIdByType = ParametricSearch.makeFeatureIdByTypeMap(
> UtilHttp.getParameterMap(request))
>
> -combQuery = new BooleanQuery.Builder()
> +combQuery = new BooleanQuery()
>
>  try {
>  DirectoryReader reader = DirectoryReader.open(FSDirectory.open(new
> File(SearchWorker.getIndexPath("content")).toPath()))
> @@ -66,7 +64,7 @@ if (queryLine || siteId) {
>  }
>
>  if (searchFeature1 || searchFeature2 || searchFeature3 ||
> !featureIdByType.isEmpty()) {
> -featureQuery = new BooleanQuery.Builder()
> +featureQuery = new BooleanQuery()
>  featuresRequired = BooleanClause.Occur.MUST
>  if ("any".equals(parameters.any_or_all)) {
>  featuresRequired = BooleanClause.Occur.SHOULD
> @@ -92,12 +90,12 @@ if (searchFeature1 || searchFeature2 ||
>  termQuery = new TermQuery(new Term("feature", value))
>  featureQuery.add(termQuery, featuresRequired)
>  }
> -combQuery.add(featureQuery.build(), featuresRequired)
> +combQuery.add(featureQuery, featuresRequired)
>  }
>  }
>  if (searcher) {
>  TopScoreDocCollector collector = TopScoreDocCollector.create(100)
> //defaulting to 100 results
> -searcher.search(combQuery.build(), collector)
> +searcher.search(combQuery, collector)
>  ScoreDoc[] hits = collector.topDocs().scoreDocs
>
>  contentList = [] as ArrayList
>
> Modified: ofbiz/ofbiz-plugins/trunk/lucene/groovyScripts/content/
> SearchProducts.groovy
> URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/
> lucene/groovyScripts/content/SearchProducts.groovy?rev=
> 1794770=1794769=1794770=diff
>