Re: (Edge)NGramFilterFactory and highlight

2014-12-20 Thread Mingchun Zhao
Hi Bjørn,

>From solr4.4, the behavior of end offsets in EdgeNGramFilterFactory
was changed due to the following issue,
https://issues.apache.org/jira/browse/LUCENE-3907
The related source code in this patch as below,
==
+  if (version.onOrAfter(Version.LUCENE_44)) {
+// Never update offsets
+updateOffsets = false;
+  } else {
+// if length by start + end offsets doesn't match the
term text then assume
+// this is a synonym and don't adjust the offsets.
+updateOffsets = (tokStart + curTermLength) == tokEnd;
+  }
==

It seems that there is no any property for specifying the previous
behavior of offsets as in LUCENE_43.
Therefore, you might have to set luceneMatchVersion to deal with it as
you mentioned.
However, it would be better to apply luceneMatchVersion just on the
EdgeNGramFilterFactory as below,
==

==
The setting of LUCENE_43 in
solrconfig.xml
will also affect other configurations.

Regards,
Mingchun


2014-12-19 23:26 GMT+09:00 Bjørn Hjelle :
> Hi,
>
> based on this example:
> http://www.cominvent.com/2012/01/25/super-flexible-autocomplete-with-solr/
> I have earlier successfully implemented highlight of terms in
> (Edge)NGram-analyzed fields.
>
> In a new project, however, with Solr 4.10.2 it does not work.
>
> In the Solr admin analysis page I see the following in Solr 4.10.2 
> (simplified):
>
> ENGTF  text  t  te  tes  test
>start 0  0   00
>end   4  4   44
>
> But if I change to LUCENE_43 in solrconfig.xml, and reload the
> analysis page I get this:
>
> ENGTF  text  t  te  tes  test
>start 0  0   00
>end   1  2   34
>
> So, in 4.10.2 it is not able to find the correct end-positions and the
> highlighter will instead highlight the complete word ("test" in this
> case).
>
>
> To reproduce  this:
> 1. download Solr 4.10.2
> 2. In the collection1 schema.xml, add field type:
>
>
> 
> 
>  mapping="mapping-ISOLatin1Accent.txt"/>
> 
>  generateWordParts="1" generateNumberParts="1" catenateWords="0"
> catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
> 
>  maxGramSize="20" minGramSize="1"/>
>  pattern="([^\w\d\*æøåÆØÅ ])" replacement="" replace="all"/>
> 
> 
>  mapping="mapping-ISOLatin1Accent.txt"/>
> 
>  generateWordParts="0" generateNumberParts="0" catenateWords="0"
> catenateNumbers="0" catenateAll="0" splitOnCaseChange="0"/>
> 
>  pattern="([^\w\d\*æøåÆØÅ ])" replacement="" replace="all"/>
>  pattern="^(.{20})(.*)?" replacement="$1" replace="all"/>
> 
> 
>
> 3. Start solr and in analysis page add "Test" to Field Value (Index)
> -field and check the output.
> 4. Then change to this in solrconfig.xml
>
>   LUCENE_43
>
> 5. reload the core and reload the analyis page.
> 6. you will now see that the end-positions are correct.
>
>
>
> Any ideas on how to make this work with Solr 4.10.2 without resorting
> to changing lucene version in solrconfig.xml?
>
>
> Thanks,
> Bjørn


Re: Solr Block Join Query matching Parent documents that have multiple children

2014-12-20 Thread Mikhail Khludnev
On Sat, Dec 20, 2014 at 1:32 AM, Jamie Johnson  wrote:
>
> I have the following documents indexed
> 
> 
> 0
> 1
> 
> 
> 
> physicalcharacteristics
> Black
> Green
> 
> 
> physicalcharacteristics
> Red
> Brown
> 
> 
> person
> 1
> 
> 
> physicalcharacteristics
> Pink
> Purple
> 
> 
> physicalcharacteristics
> Brown
> Blue
> 
> 
> person
> 2
> 
> 
> 
>
> I am able to get back all people that have child documents with brown hair
> and blue eyes OR pink eyes and purple hair, but is there a way to get back
> parent documents that have children that are both?
>
Did you try nest just boolean query?
q={!parent which=type_s:person}+test_haircolor_txt:Purple
+test_eyecolor_txt:Pink


> If we have another level within physicalcharacteristics is specifying the
> parent type sufficient for the parser to traverse back to the root document
> (i.e. person in this case)?
>

usually, there is no problem
http://blog.griddynamics.com/2013/12/grandchildren-and-siblings-with-block.html


>
> Lastly if the type physicalcharacteristics can appear at multiple levels is
> the best way of specifying the type to include the path so that we can
> target different levels?  So for instance type_s would be
> person/physicalcharacteristic or person/foo/physicalcharacteristic so I
> could target the correct level I suppose?
>
this is more problematic. possible workaround is to OR two alternative
nested queries.

-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics





Solr cannot find solr.xml even though it's there

2014-12-20 Thread Mike Thomsen
I'm getting the following stacktrace with Solr 4.5.0

SEVERE: null:org.apache.solr.common.SolrException: Could not load SOLR
configuration
at org.apache.solr.core.ConfigSolr.fromFile(ConfigSolr.java:71)
at org.apache.solr.core.ConfigSolr.fromSolrHome(ConfigSolr.java:98)
at 
org.apache.solr.servlet.SolrDispatchFilter.loadConfigSolr(SolrDispatchFilter.java:144)
at 
org.apache.solr.servlet.SolrDispatchFilter.createCoreContainer(SolrDispatchFilter.java:175)
at 
org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:127)
at 
org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at 
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at 
org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:105)
at 
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4830)
at 
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5510)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
at 
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1081)
at 
org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1877)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
/solr.xml cannot start Solrcommon.SolrException: solr.xml does not
exist in /opt/solr/solr-shard1
at org.apache.solr.core.ConfigSolr.fromFile(ConfigSolr.java:60)
... 20 more

I went so far as to set the permissions on solr-shard1 to global
read/write/execute (777) and yet it still cannot load the file. It doesn't
say there's a parse error or anything constructive. Any ideas as to what is
going on?


Re: Solr cannot find solr.xml even though it's there

2014-12-20 Thread Shawn Heisey
On 12/20/2014 12:27 PM, Mike Thomsen wrote:
> at java.lang.Thread.run(Thread.java:745)
> /solr.xml cannot start Solrcommon.SolrException: solr.xml does not
> exist in /opt/solr/solr-shard1
> at org.apache.solr.core.ConfigSolr.fromFile(ConfigSolr.java:60)
> ... 20 more
> 
> I went so far as to set the permissions on solr-shard1 to global
> read/write/execute (777) and yet it still cannot load the file. It doesn't
> say there's a parse error or anything constructive. Any ideas as to what is
> going on?

If you log on to the system as the user that is attempting to start the
container ... can you read that solr.xml file?

These commands would check the permissions at each point in that path so
you can see if the user in question has the appropriate rights at each
level.

ls -ald /.
ls -ald /opt/.
ls -ald /opt/solr/.
ls -ald /opt/solr/solr-shard1/.
ls -ald /opt/solr/solr-shard1/solr.xml

It does seem odd that your solr home would be at a directory called
solr-shard1 ... it makes more sense to me that it would be /opt/solr ...
and that the solr.xml would live there.  Only you know what your
directory structure is, though.

Thanks,
Shawn



Re: Solr 4.10.2 "Found core" but I get "No cores available" in dashboard page

2014-12-20 Thread solr-user
interesting.  unfortunately, time to take a break and so will have to deal
with this in the new year tho.

Merry Christmas and thanks for all the time and effort you guys put in
answering all of our questions.  It is much appreciated.



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-4-10-2-Found-core-but-I-get-No-cores-available-in-dashboard-page-tp4173602p4175423.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr cannot find solr.xml even though it's there

2014-12-20 Thread Mike Thomsen
It's supposed to be a simple two shard configuration of SolrCloud with two
copies of Solr running in different tomcat servers on the same box. I can
read the solr.xml just fine as that user (vagrant) and checked out the
permissions and there's nothing obviously wrong there.

On Sat, Dec 20, 2014 at 3:40 PM, Shawn Heisey  wrote:

> On 12/20/2014 12:27 PM, Mike Thomsen wrote:
> > at java.lang.Thread.run(Thread.java:745)
> > /solr.xml cannot start Solrcommon.SolrException: solr.xml does not
> > exist in /opt/solr/solr-shard1
> > at org.apache.solr.core.ConfigSolr.fromFile(ConfigSolr.java:60)
> > ... 20 more
> >
> > I went so far as to set the permissions on solr-shard1 to global
> > read/write/execute (777) and yet it still cannot load the file. It
> doesn't
> > say there's a parse error or anything constructive. Any ideas as to what
> is
> > going on?
>
> If you log on to the system as the user that is attempting to start the
> container ... can you read that solr.xml file?
>
> These commands would check the permissions at each point in that path so
> you can see if the user in question has the appropriate rights at each
> level.
>
> ls -ald /.
> ls -ald /opt/.
> ls -ald /opt/solr/.
> ls -ald /opt/solr/solr-shard1/.
> ls -ald /opt/solr/solr-shard1/solr.xml
>
> It does seem odd that your solr home would be at a directory called
> solr-shard1 ... it makes more sense to me that it would be /opt/solr ...
> and that the solr.xml would live there.  Only you know what your
> directory structure is, though.
>
> Thanks,
> Shawn
>
>


Re: Solr cannot find solr.xml even though it's there

2014-12-20 Thread Shawn Heisey
On 12/20/2014 3:26 PM, Mike Thomsen wrote:
> It's supposed to be a simple two shard configuration of SolrCloud with two
> copies of Solr running in different tomcat servers on the same box. I can
> read the solr.xml just fine as that user (vagrant) and checked out the
> permissions and there's nothing obviously wrong there.

Do you have something like selinux or apparmor enabled on the system
that might be interfering with system permissions?  Redhat operating
systems ship with selinux enabled, and I believe that Ubuntu ships with
apparmor enabled.  These can cause *very* strange things to happen.
Unless you want to provide custom configs to allow Solr to work, you
should probably disable anything like this.

Side issue: Solr (including cloud) is a lot more straightforward if you
only run one Solr instance per machine, hosting multiple cores.
Normally, the only time you should run more than one Solr instance per
machine is if you are setting up a proof of concept for SolrCloud and
want to do it on a single machine.

There have been some situations where people have gotten better
performance from running multiple Solr instances on a machine, rather
than multiple cores in one instance.  My opinion is that if you are able
to get better performance from multiple instances, that's probably a
bug, unless the reason performance is better is because of shorter GC
pauses (smaller heap per instance).

Thanks,
Shawn