RE: How to Add New Fields and Fields Types Programmatically Using Solrj

2016-07-18 Thread Jeniba Johnson

Thanks a lot Steve. It worked out.

Regards,
Jeniba Johnson




-Original Message-
From: Steve Rowe [mailto:sar...@gmail.com] 
Sent: Monday, July 18, 2016 7:57 PM
To: solr-user@lucene.apache.org
Subject: Re: How to Add New Fields and Fields Types Programmatically Using Solrj

Hi Jeniba,

You can add fields and field types using Solrj with SchemaRequest.Update 
subclasses - see here for a list: 
<http://lucene.apache.org/solr/6_1_0/solr-solrj/org/apache/solr/client/solrj/request/schema/SchemaRequest.Update.html>

There are quite a few examples of doing both in the tests: 
<https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;a=blob;f=solr/solrj/src/test/org/apache/solr/client/solrj/request/SchemaTest.java;h=72051b123aadb2df57f4bf19abfedb0ac0deb6cd;hb=refs/heads/branch_6_1>

--
Steve
www.lucidworks.com

> On Jul 18, 2016, at 1:59 AM, Jeniba Johnson <jeniba.john...@lntinfotech.com> 
> wrote:
> 
> 
> Hi,
> 
> I have configured solr5.3.1 and started Solr in schema less mode. Using 
> SolrInputDocument, Iam able to add new fields in solrconfig.xml using Solrj.
> How to specify the field type of a field using Solrj.
> 
> Eg  required="true" multivalued="false" />
> 
> How can I add field type properties using SolrInputDocument programmatically 
> using Solrj? Can anyone help with it?
> 
> 
> 
> Regards,
> Jeniba Johnson
> 
> 
> 
> 
> The contents of this e-mail and any attachment(s) may contain confidential or 
> privileged information for the intended recipient(s). Unintended recipients 
> are prohibited from taking action on the basis of information in this e-mail 
> and using or disseminating the information, and must notify the sender and 
> delete it from their system. L Infotech will not accept responsibility or 
> liability for the accuracy or completeness of, or the presence of any virus 
> or disabling code in this e-mail"



FW: How to Add New Fields and Fields Types Programmatically Using Solrj

2016-07-18 Thread Jeniba Johnson

Hi,

I have configured solr5.3.1 and started Solr in schema less mode. Using 
SolrInputDocument, Iam able to add new fields in solrconfig.xml using Solrj.
How to specify the field type of a field using Solrj.

Eg 

How can I add field type properties using SolrInputDocument programmatically 
using Solrj? Can anyone help with it?



Regards,
Jeniba Johnson




The contents of this e-mail and any attachment(s) may contain confidential or 
privileged information for the intended recipient(s). Unintended recipients are 
prohibited from taking action on the basis of information in this e-mail and 
using or disseminating the information, and must notify the sender and delete 
it from their system. L Infotech will not accept responsibility or liability 
for the accuracy or completeness of, or the presence of any virus or disabling 
code in this e-mail"


Apache solr sink issue

2014-08-18 Thread Jeniba Johnson
Hi,

I want to index a log file in Solr using Flume + Apache Solr sink
Iam referring this below mentioned URL
https://cwiki.apache.org/confluence/display/FLUME/How+to+Setup+Solr+Sink+for+Flume


Error  from flume console
2014-08-19 15:38:56,451 (concurrentUpdateScheduler-2-thread-1) [ERROR - 
org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrServer.handleError(ConcurrentUpdateSolrServer.java:354)]
 error
java.lang.Exception: Bad Request
request: http://xxx.xx.xx:8983/solr/update?wt=javabinversion=2
at 
org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrServer$Runner.run(ConcurrentUpdateSolrServer.java:208)
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:722)


Error  from solr console
473844 [qtp176433427-19] ERROR org.apache.solr.core.SolrCore  â 
org.apache.solr.common.SolrException: Document is missing mandatory uniqueKey 
field: id


Csn anyone help me with this issue and help me with the steps for integrating 
flume with solr sink



Regards,
Jeniba Johnson



The contents of this e-mail and any attachment(s) may contain confidential or 
privileged information for the intended recipient(s). Unintended recipients are 
prohibited from taking action on the basis of information in this e-mail and 
using or disseminating the information, and must notify the sender and delete 
it from their system. LT Infotech will not accept responsibility or liability 
for the accuracy or completeness of, or the presence of any virus or disabling 
code in this e-mail


Solr 4.4.0 on hadoop 2.2.0

2014-08-01 Thread Jeniba Johnson
Hi,

Iam new to solr. I have integrated solr4.9.0 and Hadoop 2.3.0.
I have changed the solrconfig.xml file  so that it can index and store the data 
on hdfs.

Solrconfig.xml
directoryFactory name=DirectoryFactory class=solr.HdfsDirectoryFactory
  str name=solr.hdfs.homehdfs://xxx.xx.xx.xx:50070/user/solr/data/str
  bool name=solr.hdfs.blockcache.enabledtrue/bool
  int name=solr.hdfs.blockcache.slab.count1/int
  bool name=solr.hdfs.blockcache.direct.memory.allocationtrue/bool
  int name=solr.hdfs.blockcache.blocksperbank16384/int
  bool name=solr.hdfs.blockcache.read.enabledtrue/bool
  bool name=solr.hdfs.blockcache.write.enabledtrue/bool
  bool name=solr.hdfs.nrtcachingdirectory.enabletrue/bool
  int name=solr.hdfs.nrtcachingdirectory.maxmergesizemb16/int
  int name=solr.hdfs.nrtcachingdirectory.maxcachedmb192/int
/directoryFactory

Commands
java -Dsolr.directoryFactory=HdfsDirectoryFactory -Dsolr.lock.type=hdfs 
-Dsolr.data.dir=hdfs:// xxx.xx.xx.xx:50070/user/solr/data/collection1 -
Dsolr.updatelog=hdfs:// xxx.xx.xx.xx:50070/user/solr/data/collection1  -jar 
start.jar

Error

48454 [coreLoadExecutor-5-thread-1] ERROR org.apache.solr.core.CoreContainer  â 
Unable to create core: collection1
org.apache.solr.common.SolrException: Problem creating directory: 
hdfs://172.29.17.40:50070/user/solr/data/collection1
at org.apache.solr.core.SolrCore.init(SolrCore.java:868)
at org.apache.solr.core.SolrCore.init(SolrCore.java:643)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:556)
at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:261)
at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:253)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
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:722)
Caused by: java.lang.RuntimeException: Problem creating directory: 
hdfs://172.29.17.40:50070/user/solr/data/collection1
at 
org.apache.solr.store.hdfs.HdfsDirectory.init(HdfsDirectory.java:87)
at 
org.apache.solr.core.HdfsDirectoryFactory.create(HdfsDirectoryFactory.java:148)
at 
org.apache.solr.core.CachingDirectoryFactory.get(CachingDirectoryFactory.java:351)
at org.apache.solr.core.SolrCore.getNewIndexDir(SolrCore.java:267)
at org.apache.solr.core.SolrCore.initIndex(SolrCore.java:479)
at org.apache.solr.core.SolrCore.init(SolrCore.java:774)
... 12 more
Caused by: java.io.IOException: Failed on local exception: 
com.google.protobuf.InvalidProtocolBufferException: Protocol message end-group 
tag did not match expected tag.; Host Details : local host is: 
cldx-1310-1182/172.29.17.40; destination host is: cldx-1310-1182:50070;
at org.apache.hadoop.net.NetUtils.wrapException(NetUtils.java:764)
at org.apache.hadoop.ipc.Client.call(Client.java:1351)
at org.apache.hadoop.ipc.Client.call(Client.java:1300)
at 
org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:206)
at com.sun.proxy.$Proxy10.getFileInfo(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at 
org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:186)
at 
org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:102)
at com.sun.proxy.$Proxy10.getFileInfo(Unknown Source)
at 
org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getFileInfo(ClientNamenodeProtocolTranslatorPB.java:651)
at org.apache.hadoop.hdfs.DFSClient.getFileInfo(DFSClient.java:1679)
at 
org.apache.hadoop.hdfs.DistributedFileSystem$17.doCall(DistributedFileSystem.java:1106)
at 
org.apache.hadoop.hdfs.DistributedFileSystem$17.doCall(DistributedFileSystem.java:1102)
at 
org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
   at 
org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:1102)
at org.apache.hadoop.fs.FileSystem.exists(FileSystem.java:1397)
at 
org.apache.solr.store.hdfs.HdfsDirectory.init(HdfsDirectory.java:62)
... 17 more
Caused by: