i got a code which talk about locking trick at the time of indexing data with Lucene.net
private static FSDirectory _directoryTemp;
private static FSDirectory _directory
if (_directoryTemp == null) _directoryTemp = FSDirectory.Open(new DirectoryInfo(_luceneDir));
if (IndexWriter.IsLocked(_directoryTemp)) IndexWriter.Unlock(_directoryTemp);
var lockFilePath = Path.Combine(_luceneDir, "write.lock");
if (File.Exists(lockFilePath)) File.Delete(lockFilePath);
but the code looks not very good. can anyone tell me why the above code is checking directory is locked or not....when directory gets locked?
see this line of code if (IndexWriter.IsLocked(_directoryTemp)) IndexWriter.Unlock(_directoryTemp); if directory is locked then it unlock it but what will happen if any index writer is indexing data and directory gets unlock then what will happen? looking for best practice. thanks
i apollogized that here i am asking about Lucene.net in c# forum. i need some basic guidance about Lucene.net index technique before working with it.
below way people store or index their data by lucene.
var doc = new Document();
// add lucene fields mapped to db fields
doc.Add(new Field("ID", oData.ID.ToString() , Field.Store.YES, Field.Index.NOT_ANALYZED));
doc.Add(new Field("Title", oData.Title, Field.Store.YES, Field.Index.ANALYZED));
doc.Add(new Field("Description", oData.Description, Field.Store.YES, Field.Index.ANALYZED));
doc.Add(new Field("Url", oData.Url, Field.Store.YES, Field.Index.ANALYZED));
// add entry to index
i like to know what is the meaning of Field.Store.YES, Field.Index.ANALYZED & Field.Index.NOT_ANALYZED
if we say Field.Store.NO then what will happen and when people should writeField.Store.NO. please give a example that when we should not store? if anything is not store in lucene index file then we can pull that data or can not search data by that field.
what is the meaning of Field.Index.ANALYZED and Field.Index.NOT_ANALYZED ? what happen when we say ANALYZED or not ANALYZED ? explain with example what actually lucene does when it encounters ANALYZED or not ANALYZED and Field.Store.NO & Field.Store.YES ?
Indeed I could, but as I already know how this works and you don't, neither of us would really learn anything. What you could do, however, is put a breakpoint in here and play around with some of the inputs to see what effect this has. Ultimately, you're trying to get to the point where you see a MessageBox that states Welcome to the program!, but this is dependent on you entering a password of basic in an input box, so if you put a breakpoint on the first line (F9 in Visual Studio) and run the program under debug mode, you'll be able to see what effect each line has. To step over lines, use F10 (this executes the current line and advances you to the next logical statement).
In the above example, Blog and Post are two different entities so can easily be referred. However, in my case, the two resultset is the result of joining of multiple tables. SO how will I specify a specific table name here? (On EntitySet as well as Type). I am not able to understand clearly what value should go into these tags? Please provide any help.
I have a stored procedure that returns multiple result set. I tried to use Translate method to handle this, however, I am not able to call this method, as it is giving error such a method doesn't exist. I am using .Net Framework 4.5 and Entity Framework 5.0. Following is what I have tried.
using (var db = new MyEntities())
using (IDbConnection oaConnection = db.Database.Connection)
// 3. Create a new instance of the OACommand class.using (IDbCommand oaCommand = oaConnection.CreateCommand())
// 4. Set the CommandType property.
oaCommand.CommandType = CommandType.StoredProcedure;
// 5. Set the CommandText property.
oaCommand.CommandText = "gsp_get_emp_details";
// 6. Execute the command and materialize the car entitiesusing (IDataReader dataReader = oaCommand.ExecuteReader())
EmployeeData empData = db.Translate<EmployeeData>(dataReader as DbDataReader);
I tried using by calling
, however it is giving compile error on db.Translate. It is giving the message that "project does not contain a definition for Translate...". May I know what's wrong with the above code? Thanks in advance for any help.
Can someone tell me how to do that? There is tons of examples in the internet, but they don't cover self hosted WCF libraries. Please if anyone, share some code, bwt i need app.config configuration, and feature to enable CORS and REST
You might be best asking the specific WCF forum[^]
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)