小编Ahm*_*ani的帖子

org.apache.lucene.index.IndexNotFoundException:org.apache.lucene.store.RAMDirectory中找不到segments*文件

我是Java和Lucene的新手.我的代码从文件中获取一行并将其存储在Lucene Index中.但是当我创建一个IndexReader搜索索引并从索引读取时,它会抛出一个异常.

我的java代码如下.在创建IndexReader它时抛出一个IndexNotFoundException

static String itemsfreq[];
static StandardAnalyzer analyzer = new StandardAnalyzer(Version.LUCENE_35);
static IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_35, analyzer);

public static void index_data(Directory indexed_document,int doc_num,IndexWriter w) throws IOException
    {
    for(int i = 0;i < itemsfreq.length;i++)
        {
        Document doc = new Document();
        doc.add(new Field(Integer.toString(doc_num)+","+itemsfreq[i],itemsfreq[i++], Field.Store.YES, Field.Index.ANALYZED));
        w.addDocument(doc);
        }
    }
//Gets string from a file and insert it in INDEX named indexed_document
public static void main(String[] args) throws IOException
    {
    BufferedReader reader = new BufferedReader(new FileReader("fullText100.txt"));
    String …
Run Code Online (Sandbox Code Playgroud)

java lucene netbeans

15
推荐指数
3
解决办法
2万
查看次数

如何使用riot js将变量传递给子标记

我在暴乱中经验不多.我创建的标签层次结构就像

<tag-1>
    <tag-2>
        <tag-3>
        </tag-3>
    </tag-2>
</tag-1>
Run Code Online (Sandbox Code Playgroud)

现在我需要将变量(whcih包含JSON)传递给"tag-3",并且在该变量的每次更新时如何更新"tag-3".现在我正在安装"tag-3"之类的

riot.mount('tag-3', { comm: "Hello" });
Run Code Online (Sandbox Code Playgroud)

其中"comm"是可变的,并且在标签"tag-3"中无法访问mount变量"comm"之后,它显示为undefined.另一件事,每个标签html都在一个单独的".tag"中,并且我正在调用其他标签,就像在"tag-1.tag"文件中调用"tag-2"并在"tag-2.tag"中调用文件我正在调用"tag-3",而在"tag-2.tag"文件中我正在安装"tag-3"

我怎样才能做到这一点 ?

javascript riot.js

6
推荐指数
1
解决办法
3599
查看次数

AT命令发送/接收SMS

我是AT命令的新手.我正在使用诺基亚E71发送和接收短信.我正在设计一个发送短信的应用程序,但我的代码无效.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO.Ports;
using System.Threading;

namespace AT_commands
    {
    public partial class Form1 : Form
        {
        SerialPort serialPort;
        public Form1()
            {
            InitializeComponent();
            }

        public void Form1_Load(object sender, EventArgs e)
            {
            this.serialPort = new SerialPort();
            this.serialPort.PortName = "COM23";
            this.serialPort.BaudRate = 9600;
            this.serialPort.Parity = Parity.None;
            this.serialPort.DataBits = 8;
            this.serialPort.StopBits = StopBits.One;
            this.serialPort.Handshake = Handshake.RequestToSend;
            this.serialPort.DtrEnable = true;
            this.serialPort.RtsEnable = true;
            this.serialPort.NewLine = System.Environment.NewLine;
            send_sms();
            }
        public bool …
Run Code Online (Sandbox Code Playgroud)

c# sms nokia visual-studio-2010 at-command

2
推荐指数
1
解决办法
3万
查看次数