Schema for indexing PDF/Doc/XLS files

2009-04-05 Thread Veselin K
Hello, 
I just got the example of Solr 1.4 and Jetty running nicely, as expected.

I'm trying to design my Schema at the moment.
My goal is to index PDF/Doc/XLS files with the following fields:

0. ID number
1. Filename
2. File path
3. Modification date
4. File contents 
5. Number of pages

- Any tips on what type of fields should I use to get this data indexed?

- Is there a way to get the ID number incremented automatically by Solr,
  each time a document is added to the index?

- Would I be able to extract the information above using just the
  Solr/Tika features? Or would I have to source all values myself, except
  "file contents" and pass them to solr when indexing?


Thank you much.

Regards,
Veselin K



Pass Double Quotes using SolrJ

2009-04-05 Thread dabboo

Hi,

I want to pass double quotes to my solr from the front end, so that it can
return the specific results of that particular phrase which is there in
double quotes. 

If I use httpClient, it doesnt allow me to send the query in this format. As
it throws me an invalid query exception. 

I want to know, if I can do this with SolrJ Client. If yes, can somebody
please let me know as how SolrJ is doing this and parsing this type of
query.

Thanks,
Amit Garg
-- 
View this message in context: 
http://www.nabble.com/Pass-Double-Quotes-using-SolrJ-tp22902404p22902404.html
Sent from the Solr - User mailing list archive at Nabble.com.



Re: Composite POJO support

2009-04-05 Thread Praveen Kumar Jayaram


Hi Noble,

Storing fields as Strings means I have to use a POJO for this activity
right? If so I am done.
But according to your suggestion "Let the FieldType in Solr parse and create
appropriate data structure".
How am I going to do this? Am very new to Solr. So please don't mind if I
dumb questions.

Please give some sample example if possible.



Noble Paul നോബിള്‍  नोब्ळ् wrote:
> 
> On Fri, Apr 3, 2009 at 11:28 AM, Praveen Kumar Jayaram
>  wrote:
>>
>>
>> Thanks for the reply Noble Paul.
>> In my application I will be having multiple types of object and the
>> number
>> of properties in each object will vary.
>> So I have made them as FieldType and defined in schema.xml also
> The POJO is a client side Object. It is converted to xml before
> POSTING the data to Solr. The client side code is totally agnostic of
> the field type in Solr schema.
> 
> 
>>
>> How do I store  the POJO without declaring it as a FieldType?
>> Solr needs to recognize a type right?
> 
> What you can do is to write your field value as one String. Let the
> FieldType in Solr parse and create appropriate data structure.
>>
>>
>>
>> Noble Paul നോബിള്‍  नोब्ळ् wrote:
>>>
>>> why is the POJO extending FieldType?
>>> it does not have to.
>>>
>>> composite types are not supported.because Solr cannot support that.
>>> But the field can be a List or array.
>>>
>>> On Thu, Apr 2, 2009 at 5:00 PM, Praveen Kumar Jayaram
>>>  wrote:

 Could someone give suggestions for this issue?


 Praveen Kumar Jayaram wrote:
>
> Hi
>
> I am trying to have a complex POJO type in Solr 1.3
> i.e Object inside object.
>
> Below is a sample Field created,
>
> public class TestType extends FieldType{
>     @Field
>     private String requestorID_s_i_s_nm;
>
>     @Field
>     private String partNumber;
>
>     @Field
>     private String requestorName_s_i_s_nm;
>
>     @Field
>     private InnerType innerType;
> }
>
> Where InnerType is another custom Java type.
>
> public class InnerType extends FieldType{
>       private String name_s_i_s_nm;
> }
>
>
> The schema configuration is as shown below,
>
> 
>  sortMissingLast="true" omitNorms="true"/>
>  sortMissingLast="true" omitNorms="true"/>
> 
> 
>
> When I try to add an TestType POJO using below code, am getting unkown
> field "innerType" error,
>
> String url = "http://localhost:8983/solr";;
> SolrServer server = new CommonsHttpSolrServer( url );
>
> InnerType inner = new InnerType();
> inner.setName_s_i_s_nm("Test");
>
> TestType praveen = new TestType();
> praveen.setPartNumber("01-0001");
> praveen.setRequestorID_s_i_s_nm("");
> praveen.setRequestorName_s_i_s_nm("Praveen Kumar Jayaram");
> praveen.setInnerType(inner);
>
> server.addBean(praveen);
> UpdateRequest req = new UpdateRequest();
> req.setAction( UpdateRequest.ACTION.COMMIT, false, false );
> UpdateResponse res = req.process(server);
>
> Initially POJO was getting added when it was not composite POJO.
> After trying to have composite POJO things are not working.
> What is that I am doing wrong??
>
> Any help will be appreciated.
>
>
>


 -
 Regards,
 Praveen
 --
 View this message in context:
 http://www.nabble.com/Composite-POJO-support-tp22841854p22845799.html
 Sent from the Solr - User mailing list archive at Nabble.com.


>>>
>>>
>>>
>>> --
>>> --Noble Paul
>>>
>>>
>>
>>
>> -
>> Regards,
>> Praveen
>> --
>> View this message in context:
>> http://www.nabble.com/Composite-POJO-support-tp22841854p22862433.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> --Noble Paul
> 
> 


-
Regards,
Praveen
-- 
View this message in context: 
http://www.nabble.com/Composite-POJO-support-tp22841854p22902406.html
Sent from the Solr - User mailing list archive at Nabble.com.



Re: Composite POJO support

2009-04-05 Thread Noble Paul നോബിള്‍ नोब्ळ्
OK . That is not a good solution.

In Solr, you can only have a flat document structure. Where each field
is a primitive (String, Number, Date) or a List of primitives.So, the
SolrJ API only supports these . You may really not need a Custome
type.



On Mon, Apr 6, 2009 at 11:07 AM, Praveen Kumar Jayaram
 wrote:
>
>
> Hi Noble,
>
> Storing fields as Strings means I have to use a POJO for this activity
> right? If so I am done.
> But according to your suggestion "Let the FieldType in Solr parse and create
> appropriate data structure".
> How am I going to do this? Am very new to Solr. So please don't mind if I
> dumb questions.
>
> Please give some sample example if possible.
>
>
>
> Noble Paul നോബിള്‍  नोब्ळ् wrote:
>>
>> On Fri, Apr 3, 2009 at 11:28 AM, Praveen Kumar Jayaram
>>  wrote:
>>>
>>>
>>> Thanks for the reply Noble Paul.
>>> In my application I will be having multiple types of object and the
>>> number
>>> of properties in each object will vary.
>>> So I have made them as FieldType and defined in schema.xml also
>> The POJO is a client side Object. It is converted to xml before
>> POSTING the data to Solr. The client side code is totally agnostic of
>> the field type in Solr schema.
>>
>>
>>>
>>> How do I store  the POJO without declaring it as a FieldType?
>>> Solr needs to recognize a type right?
>>
>> What you can do is to write your field value as one String. Let the
>> FieldType in Solr parse and create appropriate data structure.
>>>
>>>
>>>
>>> Noble Paul നോബിള്‍  नोब्ळ् wrote:

 why is the POJO extending FieldType?
 it does not have to.

 composite types are not supported.because Solr cannot support that.
 But the field can be a List or array.

 On Thu, Apr 2, 2009 at 5:00 PM, Praveen Kumar Jayaram
  wrote:
>
> Could someone give suggestions for this issue?
>
>
> Praveen Kumar Jayaram wrote:
>>
>> Hi
>>
>> I am trying to have a complex POJO type in Solr 1.3
>> i.e Object inside object.
>>
>> Below is a sample Field created,
>>
>> public class TestType extends FieldType{
>>     @Field
>>     private String requestorID_s_i_s_nm;
>>
>>     @Field
>>     private String partNumber;
>>
>>     @Field
>>     private String requestorName_s_i_s_nm;
>>
>>     @Field
>>     private InnerType innerType;
>> }
>>
>> Where InnerType is another custom Java type.
>>
>> public class InnerType extends FieldType{
>>       private String name_s_i_s_nm;
>> }
>>
>>
>> The schema configuration is as shown below,
>>
>> 
>> > sortMissingLast="true" omitNorms="true"/>
>> > sortMissingLast="true" omitNorms="true"/>
>> 
>> 
>>
>> When I try to add an TestType POJO using below code, am getting unkown
>> field "innerType" error,
>>
>> String url = "http://localhost:8983/solr";;
>> SolrServer server = new CommonsHttpSolrServer( url );
>>
>> InnerType inner = new InnerType();
>> inner.setName_s_i_s_nm("Test");
>>
>> TestType praveen = new TestType();
>> praveen.setPartNumber("01-0001");
>> praveen.setRequestorID_s_i_s_nm("");
>> praveen.setRequestorName_s_i_s_nm("Praveen Kumar Jayaram");
>> praveen.setInnerType(inner);
>>
>> server.addBean(praveen);
>> UpdateRequest req = new UpdateRequest();
>> req.setAction( UpdateRequest.ACTION.COMMIT, false, false );
>> UpdateResponse res = req.process(server);
>>
>> Initially POJO was getting added when it was not composite POJO.
>> After trying to have composite POJO things are not working.
>> What is that I am doing wrong??
>>
>> Any help will be appreciated.
>>
>>
>>
>
>
> -
> Regards,
> Praveen
> --
> View this message in context:
> http://www.nabble.com/Composite-POJO-support-tp22841854p22845799.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>



 --
 --Noble Paul


>>>
>>>
>>> -
>>> Regards,
>>> Praveen
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Composite-POJO-support-tp22841854p22862433.html
>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> --Noble Paul
>>
>>
>
>
> -
> Regards,
> Praveen
> --
> View this message in context: 
> http://www.nabble.com/Composite-POJO-support-tp22841854p22902406.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>



-- 
--Noble Paul